diff options
author | Mark Heffernan <meheff@google.com> | 2017-09-27 10:08:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-09-27 10:14:47 -0700 |
commit | 64cca2be776a332e1e9e8e7c6bbf1b170020e819 (patch) | |
tree | ba031a14ff2a00afa325933052a69905492b5ff8 /tensorflow/compiler/xla/service/tuple_simplifier.cc | |
parent | e2b96109c25d42b362c238dc3785e38083137d07 (diff) |
Do not simplify Tuple->GetTupleElement->Tuple constructs in TupleSimplifier if
the input and output tuples are not compatible.
PiperOrigin-RevId: 170213262
Diffstat (limited to 'tensorflow/compiler/xla/service/tuple_simplifier.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/tuple_simplifier.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/tuple_simplifier.cc b/tensorflow/compiler/xla/service/tuple_simplifier.cc index f92116ec19..8c054e1ea8 100644 --- a/tensorflow/compiler/xla/service/tuple_simplifier.cc +++ b/tensorflow/compiler/xla/service/tuple_simplifier.cc @@ -81,6 +81,11 @@ StatusOr<bool> TupleSimplifier::Run(HloModule* module) { if (top_tuple == nullptr) { top_tuple = operand->mutable_operand(0); + if (!ShapeUtil::Compatible(top_tuple->shape(), + instruction->shape())) { + can_simplify = false; + break; + } } else if (top_tuple != operand->operand(0)) { can_simplify = false; break; |