aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_computation.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-03-20 14:33:19 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-20 14:36:15 -0700
commit546d1d467372a176f337f2614165c6d754a386da (patch)
tree3cd9382a91d16523b9249c9fbefb2ac8980f8eaf /tensorflow/compiler/xla/service/hlo_computation.cc
parenta0e07f998b388f0ecc7b7cf2256522f28482b285 (diff)
[XLA] Simplify the HLO proto: don't nest the fusion computation in an fusion HloInstructionProto.
PiperOrigin-RevId: 189811729
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_computation.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_computation.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_computation.cc b/tensorflow/compiler/xla/service/hlo_computation.cc
index f99c7cf5e4..4e852190a8 100644
--- a/tensorflow/compiler/xla/service/hlo_computation.cc
+++ b/tensorflow/compiler/xla/service/hlo_computation.cc
@@ -406,18 +406,15 @@ HloComputationProto HloComputation::ToProto() const {
/* static */ StatusOr<std::unique_ptr<HloComputation>>
HloComputation::CreateFromProto(
HloModule* module, const HloComputationProto& proto,
- const tensorflow::gtl::FlatMap<string, HloComputation*>& computation_map,
- const std::function<void(std::unique_ptr<HloComputation>)>&
- add_fused_computation,
- HloInstruction* fusion_instruction) {
+ const tensorflow::gtl::FlatMap<string, HloComputation*>& computation_map) {
std::vector<std::unique_ptr<HloInstruction>> instructions;
tensorflow::gtl::FlatMap<string, HloInstruction*> instruction_map;
int64 parameter_count = 0;
for (const HloInstructionProto& instruction_proto : proto.instructions()) {
- TF_ASSIGN_OR_RETURN(std::unique_ptr<HloInstruction> instruction,
- HloInstruction::CreateFromProto(
- module, instruction_proto, instruction_map,
- computation_map, add_fused_computation));
+ TF_ASSIGN_OR_RETURN(
+ std::unique_ptr<HloInstruction> instruction,
+ HloInstruction::CreateFromProto(module, instruction_proto,
+ instruction_map, computation_map));
if (instruction->opcode() == HloOpcode::kParameter) {
parameter_count++;
}
@@ -429,8 +426,9 @@ HloComputation::CreateFromProto(
TF_RET_CHECK(!proto.root_name().empty());
TF_RET_CHECK(ContainsKey(instruction_map, proto.root_name()));
HloInstruction* root = instruction_map.at(proto.root_name());
- return WrapUnique(new HloComputation(
- proto.name(), parameter_count, &instructions, root, fusion_instruction));
+ return WrapUnique(new HloComputation(proto.name(), parameter_count,
+ &instructions, root,
+ /*fusion_instruction=*/nullptr));
}
void HloComputation::FuseInstructionsInto(