aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-10-02 23:37:58 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-02 23:42:10 -0700
commit3d452dbcf7e1a71ba449f6acf7342cdd1dd11859 (patch)
treea8faad589a277e4946dda39d3caafad2b67c7d26 /tensorflow/compiler/xla
parentac15fb000dc0558495b62e897206e2c4ad189c5a (diff)
[XLA] In the HLO parser, give the module a non-empty default name.
Otherwise, when parsing a single instruction, the parsed module doesn't have a name, which won't pass the hlo verifier check. PiperOrigin-RevId: 215519412
Diffstat (limited to 'tensorflow/compiler/xla')
-rw-r--r--tensorflow/compiler/xla/service/hlo_parser.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_parser.cc b/tensorflow/compiler/xla/service/hlo_parser.cc
index 0440f1b54f..dd62988bcc 100644
--- a/tensorflow/compiler/xla/service/hlo_parser.cc
+++ b/tensorflow/compiler/xla/service/hlo_parser.cc
@@ -391,7 +391,7 @@ Status HloParser::Run(HloModule* module) {
// This means that the text is a single HLO instruction.
if (!ParseSingleInstruction(module)) {
return InvalidArgument(
- "Syntax error when trying to parse the text as single "
+ "Syntax error when trying to parse the text as a single "
"HloInstruction:\n%s",
GetError());
}
@@ -3348,14 +3348,14 @@ bool HloParser::ParseSingleInstruction(HloModule* module) {
StatusOr<std::unique_ptr<HloModule>> ParseHloString(
absl::string_view str, const HloModuleConfig& config) {
- auto module = absl::make_unique<HloModule>(/*name=*/"", config);
+ auto module = absl::make_unique<HloModule>(/*name=*/"_", config);
HloParser parser(str);
TF_RETURN_IF_ERROR(parser.Run(module.get()));
return std::move(module);
}
StatusOr<std::unique_ptr<HloModule>> ParseHloString(absl::string_view str) {
- auto module = absl::make_unique<HloModule>(/*name=*/"", HloModuleConfig());
+ auto module = absl::make_unique<HloModule>(/*name=*/"_", HloModuleConfig());
HloParser parser(str);
TF_RETURN_IF_ERROR(parser.Run(module.get()));
return std::move(module);