mlx.core.jvp#
- jvp(fun: Callable, primals: list[array], tangents: list[array]) tuple[list[array], list[array]] #
Compute the Jacobian-vector product.
This computes the product of the Jacobian of a function
fun
evaluated atprimals
with thetangents
.- Parameters:
fun (Callable) – A function which takes a variable number of
array
and returns a singlearray
or list ofarray
.primals (list(array)) – A list of
array
at which to evaluate the Jacobian.tangents (list(array)) – A list of
array
which are the “vector” in the Jacobian-vector product. Thetangents
should be the same in number, shape, and type as the inputs offun
(i.e. theprimals
).
- Returns:
A list of the Jacobian-vector products which is the same in number, shape, and type of the inputs to
fun
.- Return type: