diff options
author | 2017-09-28 23:07:12 -0700 | |
---|---|---|
committer | 2017-09-28 23:14:07 -0700 | |
commit | 9b1b5d85b9ce3c812dc772da1f3f5d09581e5b49 (patch) | |
tree | 798207232f7ae8240d5ee2e7f934669ed1318bef /tensorflow/compiler/xla/service/hlo_alias_analysis.cc | |
parent | 75e07e01a41434fdf40eea6291fe7bc47ad74312 (diff) |
[XLA] Make HloComputation::instructions() return a view of HloInstruction*s.
Currently it returns a view of unique_ptr<HloInstruction>s. But the
fact that these are unique_ptrs is an implementation detail, and it's
ugly to leak it everywhere.
PiperOrigin-RevId: 170445375
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_alias_analysis.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_alias_analysis.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_alias_analysis.cc b/tensorflow/compiler/xla/service/hlo_alias_analysis.cc index 83756bab80..4d853e65d4 100644 --- a/tensorflow/compiler/xla/service/hlo_alias_analysis.cc +++ b/tensorflow/compiler/xla/service/hlo_alias_analysis.cc @@ -376,8 +376,7 @@ string HloAliasAnalysis::ToString() const { StrAppend(&out, " Buffers at each position:\n"); for (const std::unique_ptr<HloComputation>& computation : module_->computations()) { - for (const std::unique_ptr<HloInstruction>& instruction : - computation->instructions()) { + for (const HloInstruction* instruction : computation->instructions()) { StrAppend(&out, " ", instruction->name(), ":\n"); if (ShapeUtil::IsTuple(instruction->shape())) { ShapeUtil::ForEachSubshape( @@ -385,13 +384,13 @@ string HloAliasAnalysis::ToString() const { [&out, &instruction, this](const Shape&, const ShapeIndex& index) { StrAppend(&out, " tuple index ", index.ToString(), ":\n"); for (const HloBuffer* buffer : - ComputeBuffersAt(instruction.get(), index)) { + ComputeBuffersAt(instruction, index)) { StrAppend(&out, " ", buffer->ToString(), "\n"); } }); } else { for (const HloBuffer* buffer : - ComputeBuffersAt(instruction.get(), /*index=*/{})) { + ComputeBuffersAt(instruction, /*index=*/{})) { StrAppend(&out, " ", buffer->ToString(), "\n"); } } |