aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/while_loop_simplifier.cc
diff options
context:
space:
mode:
authorGravatar Jacques Pienaar <jpienaar@google.com>2018-02-28 00:07:55 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-28 00:11:59 -0800
commit503d9b522e28272e032bc45a10e3c0f21398a16e (patch)
tree1c635afe83ac48ed0180f5975e1fa75dbf022124 /tensorflow/compiler/xla/service/while_loop_simplifier.cc
parentc38a16dbcc5de5fa5579a3e48ec12be316a2cb3f (diff)
[XLA:Evaluator] Handle while loop.
* Add while loop support to HloEvaluator; * Add a max_loop_iteration argument to the interpreter's constructor to limit the number of loop iterations that will be evaluated (or no bound if -1). Maintain current constant propagation behavior by setting limit to 0 for evaluators used for CP. PiperOrigin-RevId: 187287574
Diffstat (limited to 'tensorflow/compiler/xla/service/while_loop_simplifier.cc')
-rw-r--r--tensorflow/compiler/xla/service/while_loop_simplifier.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/while_loop_simplifier.cc b/tensorflow/compiler/xla/service/while_loop_simplifier.cc
index 981de9b220..c9d77c9376 100644
--- a/tensorflow/compiler/xla/service/while_loop_simplifier.cc
+++ b/tensorflow/compiler/xla/service/while_loop_simplifier.cc
@@ -212,7 +212,7 @@ static optional<int64> GetLoopTripCount(HloInstruction* while_op) {
// Now that we know the index of the induction variable, we can we can try to
// compute how many times the loop executes. Start by computing the induction
// variable's initial value.
- HloEvaluator evaluator;
+ HloEvaluator evaluator(/*max_loop_iterations=*/0);
auto* while_init = while_op->mutable_operand(0);
auto* indvar_init = while_init->mutable_operand(*indvar_tuple_idx);
StatusOr<std::unique_ptr<Literal>> indvar_init_result =