aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/reshape_mover.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-07-26 08:35:19 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-26 08:39:12 -0700
commit78a9b95436f45438abf3e818307f707e9ae92343 (patch)
tree94dfdfa894f0dec6ba917b905908985f6594b223 /tensorflow/compiler/xla/service/reshape_mover.cc
parent49495697cddef73a0dd870176dab488bb2a65520 (diff)
[XLA] Finish normalizing fusion computations into standard computations
PiperOrigin-RevId: 163210327
Diffstat (limited to 'tensorflow/compiler/xla/service/reshape_mover.cc')
-rw-r--r--tensorflow/compiler/xla/service/reshape_mover.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/reshape_mover.cc b/tensorflow/compiler/xla/service/reshape_mover.cc
index 2d35ba5e54..1c648d58c7 100644
--- a/tensorflow/compiler/xla/service/reshape_mover.cc
+++ b/tensorflow/compiler/xla/service/reshape_mover.cc
@@ -312,10 +312,17 @@ StatusOr<bool> TrySinkReshapeOrTranspose(HloComputation* computation,
StatusOr<bool> ReshapeMover::Run(HloModule* module) {
bool changed = false;
- for (const auto& comp : module->computations()) {
+ std::vector<HloComputation*> computations;
+ for (auto& computation : module->computations()) {
+ if (computation->IsFusionComputation()) {
+ continue;
+ }
+ computations.push_back(computation.get());
+ }
+ for (const auto& comp : computations) {
for (HloInstruction* instruction : comp->MakeInstructionPostOrder()) {
TF_ASSIGN_OR_RETURN(bool did_change,
- TrySinkReshapeOrTranspose(comp.get(), instruction));
+ TrySinkReshapeOrTranspose(comp, instruction));
changed |= did_change;
}
}