diff options
author | 2017-07-04 03:21:37 -0700 | |
---|---|---|
committer | 2017-07-04 03:26:31 -0700 | |
commit | f9f078e6f344f16653c5e5822e22e64cc5f6ed60 (patch) | |
tree | 9576894bf96552e0286e3a99879a6881ddc81d81 /tensorflow/compiler/xla/service/hlo_module.h | |
parent | 03f44a7baa049c1298b7b48cdda596fb0b9c471a (diff) |
Make HloInstruction names unique with an HloModule.
This will allow most uses of HloInstruction::FullyQualifiedName() to
be replaced with HloInstruction::Name().
PiperOrigin-RevId: 160879036
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_module.h')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_module.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_module.h b/tensorflow/compiler/xla/service/hlo_module.h index d089493c70..ae8ec02fbd 100644 --- a/tensorflow/compiler/xla/service/hlo_module.h +++ b/tensorflow/compiler/xla/service/hlo_module.h @@ -124,13 +124,16 @@ class HloModule { return computation_name_uniquer_.GetUniqueName(prefix); } + // Returns the NameUniquer for uniquing instruction names in this module. + NameUniquer& instruction_name_uniquer() { return instruction_name_uniquer_; } + private: HloComputation* AddComputationInternal( std::unique_ptr<HloComputation> computation); const string name_; HloModuleConfig config_; - HloComputation* entry_computation_; + HloComputation* entry_computation_ = nullptr; std::vector<std::unique_ptr<HloComputation>> computations_; // Random number generator engine to use when generating random numbers per @@ -144,8 +147,10 @@ class HloModule { bool has_entry_computation_handle_ = false; VersionedComputationHandle entry_computation_handle_; - // Unique name generator for computation names, which are unique per module. - NameUniquer computation_name_uniquer_; + // Unique name generator for computation and instruction names, which are + // unique per module. + NameUniquer computation_name_uniquer_{/*separator=*/"."}; + NameUniquer instruction_name_uniquer_{/*separator=*/"."}; }; } // namespace xla |