tidy3d.plugins.autograd.differential_operators.grad#
- class grad#
Bases:
Returns a function that computes the gradient of fun with respect to x.
- Parameters:
fun (Callable) β The function to differentiate. Should return a scalar value, or a tuple of (scalar_value, auxiliary_data) if has_aux is True.
x (ArrayLike) β The point at which to evaluate the gradient.
has_aux (bool = False) β If True, fun returns auxiliary data as the second element of a tuple.
- Returns:
A function that takes the same arguments as fun and returns its gradient at x.
- Return type:
Callable
Inherited Common Usage