Skip to content

Commit

Permalink
[XLA] DOT dumper: Print constant shape when we elide the constant's v…
Browse files Browse the repository at this point in the history
…alue.

For example, instead of "operand 1 = %constant.42", we now print
"operand 1 = %constant.42 (f32[100])".

PiperOrigin-RevId: 173741373
  • Loading branch information
Justin Lebar authored and tensorflower-gardener committed Oct 28, 2017
1 parent 45c5118 commit 9f4b12b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tensorflow/compiler/xla/service/hlo_graph_dumper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,14 @@ string HloDotDumper::GetInstructionNodeInlinedOperands(
return Printf("%s (%s)", constant->literal().GetAsString(elem_idx),
ShapeUtil::HumanString(constant->shape()));
}
string constant_name;
if (tensorflow::StringPiece(constant->name()).starts_with("%constant")) {
return constant->name();
constant_name = constant->name();
} else {
constant_name = StrCat("constant ", constant->name());
}
return StrCat("constant ", constant->name());
return Printf("%s %s", constant_name,
ShapeUtil::HumanString(constant->shape()));
};

// Special case: If instr is a parameter to a fusion node, check whether the
Expand Down

0 comments on commit 9f4b12b

Please sign in to comment.