-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
invalidThis doesn't seem rightThis doesn't seem right
Description
I intend to write the second example in the GradientTape tutorial
x = tf.constant(3.0)
with tf.GradientTape() as g:
g.watch(x)
with tf.GradientTape() as gg:
gg.watch(x)
y = x * x
dy_dx = gg.gradient(y, x) # Will compute to 6.0
d2y_dx2 = g.gradient(dy_dx, x) # Will compute to 2.0
in TensorFlowCAPITest>>#testNestedGradient but the got the following error
NOT_FOUND: No gradient defined for op: OnesLike. Please see https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md for instructions on how to add C++ gradients.
It seems gradientsOf:respectTo: in VAST is not doing the same as the gradient in python.
gradientsOf:respectTo:ends up calling the C++ api TF_AddGradients- while
gradientin python calls tensorflow.python.eager.imperative_grad.imperative_grad, which calls tensorflow.python.pywrap_tensorflow.TFE_Py_TapeGradient, which is a C++ function calling ComputeGradient.
(Case reproduced in this commit)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
invalidThis doesn't seem rightThis doesn't seem right