aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_alias_analysis.cc
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2017-09-28 23:07:12 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-09-28 23:14:07 -0700
commit9b1b5d85b9ce3c812dc772da1f3f5d09581e5b49 (patch)
tree798207232f7ae8240d5ee2e7f934669ed1318bef /tensorflow/compiler/xla/service/hlo_alias_analysis.cc
parent75e07e01a41434fdf40eea6291fe7bc47ad74312 (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.cc7
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");
}
}