stop_gradient

ivy.stop_gradient(x, f=None)[source]

Stops gradient computation.

Parameters
  • x (array) – Array for which to stop the gradient.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns

The same array x, but with no gradient information.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty