[TF] Fix XLA Control Flow gradient stacks max_size creation.
authorEugene Brevdo <ebrevdo@google.com>
Wed, 17 Jan 2018 00:17:36 +0000 (16:17 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 17 Jan 2018 00:23:05 +0000 (16:23 -0800)
commitc9096fd166a9d7fdb62c6cb747a74edb73630b0c
tree4c9cd12946750b03b2dc850916fe2e16db3d955e
parent1de8ca3edb22c232b6cd4a87076bd5e0a7f6b86f
[TF] Fix XLA Control Flow gradient stacks max_size creation.

Stack creation uses tf.while_loop's maximum_iterations iff the while_loop
was created inside an XLA/TPU context.  Added several error checks to ensure
this provides useful error messages if the limited use case is not supported.

PiperOrigin-RevId: 182128135
tensorflow/python/kernel_tests/control_flow_ops_py_test.py
tensorflow/python/ops/control_flow_ops.py
tensorflow/python/ops/control_flow_util.py