copapy.jacobian#

copapy.jacobian(x, y)#

Returns the Jacobian dx/dy where x and y might be a scalar, a list of scalars, a vector or a tensor. The result has the shape x.shape + y.shape. It is calculated with one reverse-mode pass of grad per element of x.

Overloads:

For a scalar x the result is the same as of grad(x, y). The result is a list of lists if x and y are lists and otherwise a tensor. Arrays are not supported, an array can be used as tensor by cp.tensor(arr).

Parameters:
Returns:

Derivative of x with the dimensions of x and y