For tf.gradients(), do not backpropagate through integer tensors.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 26 Apr 2018 19:42:54 +0000 (12:42 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 26 Apr 2018 19:45:22 +0000 (12:45 -0700)
commitf63750645826df65b05cad505546a86f0e347674
tree8467d73780d74b0f7ef4c87f8866d3bf0a233254
parent667077cbd2cc86c4a656233a2d5f579aa4caf1f1
For tf.gradients(), do not backpropagate through integer tensors.
All integer tensors are now considered constant with respect to all `xs`.
This fixes a bug in gradients through tf.while_loop.

PiperOrigin-RevId: 194438529
14 files changed:
tensorflow/compiler/tests/tensor_array_ops_test.py
tensorflow/contrib/batching/python/ops/batch_ops_test.py
tensorflow/contrib/compiler/jit_test.py
tensorflow/python/data/kernel_tests/iterator_ops_test.py
tensorflow/python/eager/function_test.py
tensorflow/python/framework/meta_graph_test.py
tensorflow/python/kernel_tests/array_ops_test.py
tensorflow/python/kernel_tests/control_flow_ops_py_test.py
tensorflow/python/kernel_tests/dynamic_stitch_op_test.py
tensorflow/python/kernel_tests/gradient_correctness_test.py
tensorflow/python/kernel_tests/nth_element_op_test.py
tensorflow/python/kernel_tests/tensor_array_ops_test.py
tensorflow/python/kernel_tests/topk_op_test.py
tensorflow/python/ops/gradients_impl.py