Provided f(x), returns another function g(x, dy?), which gives the
gradient of f(x) with respect to x.
If dy is provided, the gradient of f(x).mul(dy).sum() with respect to
x is computed instead. f(x) must take a single tensor x and return a
single tensor y. If f() takes multiple inputs, use tf.grads instead.
Provided
f(x)
, returns another functiong(x, dy?)
, which gives the gradient off(x)
with respect tox
.If
dy
is provided, the gradient off(x).mul(dy).sum()
with respect tox
is computed instead.f(x)
must take a single tensorx
and return a single tensory
. Iff()
takes multiple inputs, usetf.grads
instead.