aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_opcode.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-07-04 08:01:20 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-04 08:06:10 -0700
commita7032f21d72dd051f09b94733ed890dcd7ceaac8 (patch)
treebaaa734c0c0b4d7dfc11f48a28e744a1b7ad5502 /tensorflow/compiler/xla/service/hlo_opcode.cc
parentf9f078e6f344f16653c5e5822e22e64cc5f6ed60 (diff)
Clarify rules for names of HloInstructions and HloOpcodes.
- The name of an HloInstruction may not contain "::", as this is used as a separator in fully qualified names. - The name of an HloOpcode may not contain ':', as this is used as a separator in extended opcode strings. PiperOrigin-RevId: 160894413
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_opcode.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_opcode.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_opcode.cc b/tensorflow/compiler/xla/service/hlo_opcode.cc
index 4d68d0d088..53a93f3dac 100644
--- a/tensorflow/compiler/xla/service/hlo_opcode.cc
+++ b/tensorflow/compiler/xla/service/hlo_opcode.cc
@@ -19,6 +19,13 @@ limitations under the License.
namespace xla {
string HloOpcodeString(HloOpcode opcode) {
+ // Note: Do not use ':' in opcode strings. It is used as a special character
+ // in these places:
+ // - In extended opcode strings (HloInstruction::ExtendedOpcodeString()), to
+ // separate the opcode from the fusion kind
+ // - In fully qualified names (HloInstruction::FullyQualifiedName()), to
+ // separate the qualifiers (name of the computation and potentially the
+ // fusion instruction) from the name
switch (opcode) {
case HloOpcode::kAbs:
return "abs";