aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_parser.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_parser.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_parser.cc b/tensorflow/compiler/xla/service/hlo_parser.cc
index bf1c7b9323..4aa4406292 100644
--- a/tensorflow/compiler/xla/service/hlo_parser.cc
+++ b/tensorflow/compiler/xla/service/hlo_parser.cc
@@ -1148,7 +1148,12 @@ bool HloParser::ParseInstruction(HloComputation::Builder* builder,
HloOpcodeString(opcode)));
}
- instruction->set_name(name);
+ instruction->SetAndSanitizeName(name);
+ if (instruction->name() != name) {
+ return Error(name_loc,
+ StrCat("illegal instruction name: ", name,
+ "; suggest renaming to: ", instruction->name()));
+ }
// Add shared attributes like metadata to the instruction, if they were seen.
if (sharding) {