pub fn jvp<'a, F>(
f: F,
primals: &[Array],
tangents: &[Array],
) -> Result<(Vec<Array>, Vec<Array>)>
Expand description
Compute the Jacobian-vector product.
This computes the product of the Jacobian of a function f
evaluated at primals
with the
tangents
.
§Params:
f
: function which takes an array ofArray
and returns an array ofArray
primals
: array ofArray
at which to evaluate the Jacobiantangents
: array ofArray
which are the “vector” in the Jacobian-vector product. Thetangents
should be the same in number, shape and type as the inputs off
, e.g. theprimals
§Returns:
Array of the Jacobian-vector products which is the same in number, shape and type of
the outputs of f