Fix API rendering of Args, Returns, Raises in gradients functions.
PiperOrigin-RevId: 209439445
This commit is contained in:
parent
e39ee34500
commit
82a0d16be3
@ -181,10 +181,10 @@ def implicit_val_and_grad(f):
|
||||
```
|
||||
|
||||
Args:
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar.
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar.
|
||||
|
||||
Returns:
|
||||
A function which, when called, returns a tuple pair.
|
||||
@ -256,10 +256,10 @@ def implicit_grad(f):
|
||||
```
|
||||
|
||||
Args:
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar.
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar.
|
||||
|
||||
Returns:
|
||||
A function which, when called, returns a list of (gradient, variable) pairs.
|
||||
@ -344,24 +344,24 @@ def gradients_function(f, params=None):
|
||||
Note that only tensors with real or complex dtypes are differentiable.
|
||||
|
||||
Args:
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar. If desired, the tensors can be elementwise multiplied by the
|
||||
tensors passed as the `dy` keyword argument to the returned gradient
|
||||
function.
|
||||
params: list of parameter names of f or list of integers indexing the
|
||||
parameters with respect to which we'll differentiate. Passing None
|
||||
differentiates with respect to all parameters.
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar. If desired, the tensors can be elementwise multiplied by the
|
||||
tensors passed as the `dy` keyword argument to the returned gradient
|
||||
function.
|
||||
params: list of parameter names of f or list of integers indexing the
|
||||
parameters with respect to which we'll differentiate. Passing None
|
||||
differentiates with respect to all parameters.
|
||||
|
||||
Returns:
|
||||
function which, when called, returns the value of f and the gradient
|
||||
of f with respect to all of `params`. The function takes an extra optional
|
||||
keyword argument "dy". Setting it allows computation of vector jacobian
|
||||
of `f` with respect to all of `params`. The function takes an extra optional
|
||||
keyword argument `dy`. Setting it allows computation of vector jacobian
|
||||
products for vectors other than the vector of ones.
|
||||
|
||||
Raises:
|
||||
ValueError: if the params are not all strings or all integers.
|
||||
ValueError: if the params are not all strings or all integers.
|
||||
"""
|
||||
|
||||
def decorated(*args, **kwds):
|
||||
@ -441,23 +441,24 @@ def val_and_grad_function(f, params=None):
|
||||
```
|
||||
|
||||
Args:
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar. If desired, the tensors can be elementwise multiplied by the
|
||||
tensors passed as the `dy` keyword argument to the returned gradient
|
||||
function.
|
||||
params: list of parameter names of f or list of integers indexing the
|
||||
parameters with respect to which we'll differentiate. Passing `None`
|
||||
differentiates with respect to all parameters.
|
||||
f: function to be differentiated. If `f` returns a scalar, this scalar will
|
||||
be differentiated. If `f` returns a tensor or list of tensors, by default
|
||||
a scalar will be computed by adding all their values to produce a single
|
||||
scalar. If desired, the tensors can be elementwise multiplied by the
|
||||
tensors passed as the `dy` keyword argument to the returned gradient
|
||||
function.
|
||||
params: list of parameter names of f or list of integers indexing the
|
||||
parameters with respect to which we'll differentiate. Passing `None`
|
||||
differentiates with respect to all parameters.
|
||||
|
||||
Returns: function which, when called, returns the value of f and the gradient
|
||||
of f with respect to all of `params`. The function takes an extra optional
|
||||
keyword argument "dy". Setting it allows computation of vector jacobian
|
||||
products for vectors other than the vector of ones.
|
||||
Returns:
|
||||
function which, when called, returns the value of f and the gradient
|
||||
of f with respect to all of `params`. The function takes an extra optional
|
||||
keyword argument "dy". Setting it allows computation of vector jacobian
|
||||
products for vectors other than the vector of ones.
|
||||
|
||||
Raises:
|
||||
ValueError: if the params are not all strings or all integers.
|
||||
ValueError: if the params are not all strings or all integers.
|
||||
"""
|
||||
|
||||
def decorated(*args, **kwds):
|
||||
|
Loading…
Reference in New Issue
Block a user