diff options
author | 2017-10-19 16:42:45 -0700 | |
---|---|---|
committer | 2017-10-19 16:49:12 -0700 | |
commit | e885d1abdce5db4a67e0b3ba85dbcc708f856645 (patch) | |
tree | 8052e4e3c06c026b2b32f272b4cd12d2c2aeab0b /tensorflow/python/eager/backprop_test.py | |
parent | 2977dccc96c343ca85cb00b50672b36c99656532 (diff) |
One less error message in gradients_function
PiperOrigin-RevId: 172818233
Diffstat (limited to 'tensorflow/python/eager/backprop_test.py')
-rw-r--r-- | tensorflow/python/eager/backprop_test.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/python/eager/backprop_test.py b/tensorflow/python/eager/backprop_test.py index 95d5f0adcb..7da8eb0c9b 100644 --- a/tensorflow/python/eager/backprop_test.py +++ b/tensorflow/python/eager/backprop_test.py @@ -381,6 +381,14 @@ class BackpropTest(test.TestCase): [tensor_shape.TensorShape(s).as_proto() for s in shape_list], backprop.make_attr([pywrap_tensorflow.TF_ATTR_SHAPE], shape_list)) + def testArgsGradientFunction(self): + + def f(*args): + return args[0] * args[0] + + grad = backprop.gradients_function(f) + self.assertAllEqual(grad(1.0)[0], 2.0) + def testMultiValueConvertToTensor(self): x = resource_variable_ops.ResourceVariable( initial_value=array_ops.constant([1.0]), name='x') |