aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/instruction_fusion.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/instruction_fusion.cc')
-rw-r--r--tensorflow/compiler/xla/service/instruction_fusion.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/instruction_fusion.cc b/tensorflow/compiler/xla/service/instruction_fusion.cc
index 482ab9b94a..24af07bd4b 100644
--- a/tensorflow/compiler/xla/service/instruction_fusion.cc
+++ b/tensorflow/compiler/xla/service/instruction_fusion.cc
@@ -211,8 +211,17 @@ bool InstructionFusion::CanFuseOnAllPaths(
StatusOr<bool> InstructionFusion::Run(HloModule* module) {
bool changed = false;
+
+ std::vector<HloComputation*> computations;
for (auto& computation : module->computations()) {
- computation_ = computation.get();
+ if (computation->IsFusionComputation()) {
+ continue;
+ }
+ computations.push_back(computation.get());
+ }
+ for (auto& computation : computations) {
+ CHECK(!computation->IsFusionComputation());
+ computation_ = computation;
// We want to be able to remove arbitrary instructions from the post order
// and also compare positions of instructions in the post order. To make