mlx.core.jvp#
- mlx.core.jvp(fun: function, 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
funevaluated atprimalswith thetangents.- Parameters:
fun (function) – A function which takes a variable number of
arrayand returns a singlearrayor list ofarray.primals (list(array)) – A list of
arrayat which to evaluate the Jacobian.tangents (list(array)) – A list of
arraywhich are the “vector” in the Jacobian-vector product. Thetangentsshould 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: