aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_computation.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-04-18 12:24:26 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-04-18 13:44:43 -0700
commit15c475463cf48b58f42ef81df8687fae79bd9c60 (patch)
tree4869df7c940e71cf86b09af3595267a577132d33 /tensorflow/compiler/xla/service/hlo_computation.cc
parent8cabc326b0081fb9015f6d70f30512f20aa0fba5 (diff)
[XLA] Fix the indentation for printing fusion computation.
Change: 153502127
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_computation.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.cc b/tensorflow/compiler/xla/service/hlo_computation.cc
index 655546d715..526c1c58b3 100644
--- a/tensorflow/compiler/xla/service/hlo_computation.cc
+++ b/tensorflow/compiler/xla/service/hlo_computation.cc
@@ -330,17 +330,27 @@ std::list<HloComputation*> HloComputation::MakeEmbeddedComputationsList()
return post_order;
}
-string HloComputation::ToString() const {
+string HloComputation::ToString(int nested_level) const {
std::ostringstream s;
+ for (int i = 0; i < nested_level; i++) {
+ s << " ";
+ }
s << name() << " " << ShapeUtil::HumanString(ComputeProgramShape())
<< " { \n";
for (const HloInstruction* instruction : MakeInstructionPostOrder()) {
+ for (int i = 0; i < nested_level; i++) {
+ s << " ";
+ }
s << " " << instruction->ToString() << "\n";
if (instruction->opcode() == HloOpcode::kFusion) {
- s << " " << instruction->fused_instructions_computation()->ToString()
+ s << instruction->fused_instructions_computation()->ToString(
+ nested_level + 1)
<< "\n";
}
}
+ for (int i = 0; i < nested_level; i++) {
+ s << " ";
+ }
s << "}";
return s.str();
}