copapy.grad#

copapy.grad(x, y)#

Returns the partial derivative dx/dy where x needs to be a scalar and y might be a scalar, a list of scalars, a vector or matrix. It uses automatic differentiation in reverse-mode.

Parameters:
  • x (Any) – Value to return derivative of

  • y (value[Any] | Sequence[value[Any]] | vector[Any] | matrix[Any]) – Value(s) to derive in respect to

Return type:

Any

Returns:

Derivative of x with the type and dimensions of y