[XLA] Augment metadata output with source-line info, as before.
PiperOrigin-RevId: 168292527
This commit is contained in:
parent
3491881522
commit
3a98035fa8
@ -811,13 +811,25 @@ string HloDotDumper::GetInstructionNodeLabel(const HloInstruction* instr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string HloDotDumper::GetInstructionNodeMetadata(const HloInstruction* instr) {
|
string HloDotDumper::GetInstructionNodeMetadata(const HloInstruction* instr) {
|
||||||
if (!show_metadata_ || instr->metadata().op_name().empty()) {
|
if (!show_metadata_) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Printf(R"(%s<br/>op_type: %s)",
|
std::vector<string> lines;
|
||||||
HtmlLikeStringSanitize(instr->metadata().op_name()),
|
if (!instr->metadata().op_name().empty()) {
|
||||||
HtmlLikeStringSanitize(instr->metadata().op_type()));
|
lines.push_back(HtmlLikeStringSanitize(instr->metadata().op_name()));
|
||||||
|
}
|
||||||
|
if (!instr->metadata().op_type().empty()) {
|
||||||
|
lines.push_back(Printf(
|
||||||
|
"op_type: %s", HtmlLikeStringSanitize(instr->metadata().op_type())));
|
||||||
|
}
|
||||||
|
if (!instr->metadata().source_file().empty() &&
|
||||||
|
instr->metadata().source_line() != 0) {
|
||||||
|
lines.push_back(Printf("op_type: %s", instr->metadata().source_file(),
|
||||||
|
instr->metadata().source_line()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Join(lines, "<br/>");
|
||||||
}
|
}
|
||||||
|
|
||||||
string HloDotDumper::GetInstructionNodeExtraInfo(const HloInstruction* instr) {
|
string HloDotDumper::GetInstructionNodeExtraInfo(const HloInstruction* instr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user