DetachΒΆ

Returns a new Tensor, detached from the current graph. The result will never require gradient.

Abstract Signature:

Detach(input: Tensor)

PyTorch

API: torch.detach
Strategy: Direct Mapping

JAX (Core)

API: jax.lax.stop_gradient
Strategy: Direct Mapping

NumPy

API: β€”
Strategy: Macro '{input}'

Keras

API: keras.ops.stop_gradient
Strategy: Direct Mapping

TensorFlow

API: tf.stop_gradient
Strategy: Direct Mapping

Apple MLX

API: mlx.core.stop_gradient
Strategy: Direct Mapping

Flax NNX

API: jax.lax.stop_gradient
Strategy: Direct Mapping

PaxML / Praxis

API: jax.lax.stop_gradient
Strategy: Direct Mapping