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 ofArrayand returns an array ofArrayprimals: array ofArrayat which to evaluate the Jacobiantangents: array ofArraywhich are the “vector” in the Jacobian-vector product. Thetangentsshould 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