warp.func_grad#

warp.func_grad(forward_fn)[source]#

Decorator to register a custom gradient function for a given forward function. The function signature must correspond to one of the function overloads in the following way: the first part of the input arguments are the original input variables with the same types as their corresponding arguments in the original function, and the second part of the input arguments are the adjoint variables of the output variables (if available) of the original function with the same types as the output variables. The function must not return anything.