copapy.grad#

copapy.grad(x, y)#
Overloads:
  • x (Any), y (value[Any]) → unifloat

  • x (Any), y (vector[Any]) → vector[float]

  • x (Any), y (tensor[Any]) → tensor[float]

  • x (Any), y (Sequence[value[Any]]) → list[unifloat]

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] | tensor[Any]) – Value(s) to derive in respect to

Returns:

Derivative of x with the type and dimensions of y