diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-04-26 12:42:54 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-26 12:45:22 -0700 |
commit | f63750645826df65b05cad505546a86f0e347674 (patch) | |
tree | 8467d73780d74b0f7ef4c87f8866d3bf0a233254 /tensorflow/contrib/batching | |
parent | 667077cbd2cc86c4a656233a2d5f579aa4caf1f1 (diff) |
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
Diffstat (limited to 'tensorflow/contrib/batching')
-rw-r--r-- | tensorflow/contrib/batching/python/ops/batch_ops_test.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/contrib/batching/python/ops/batch_ops_test.py b/tensorflow/contrib/batching/python/ops/batch_ops_test.py index fac7aff29f..e22f978dde 100644 --- a/tensorflow/contrib/batching/python/ops/batch_ops_test.py +++ b/tensorflow/contrib/batching/python/ops/batch_ops_test.py @@ -250,7 +250,7 @@ class BatchOpsTest(test.TestCase): def testUnbatchGrad(self): """Tests that batch and unbatch are differentiable.""" with self.test_session() as sess: - inp = array_ops.placeholder(dtype=dtypes.int32, shape=[1]) + inp = array_ops.placeholder(dtype=dtypes.float32, shape=[1]) batched, index, id_t = batch_ops.batch( [inp], num_batch_threads=1, max_batch_size=2, batch_timeout_micros=36000000, grad_timeout_micros=1000000, |