# tf.keras.backend.stop_gradient

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/backend/stop_gradient) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/python/keras/backend.py#L3800-L3815) |

Returns `variables` but with zero gradient w.r.t. every other variable.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.backend.stop_gradient`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/stop_gradient)

<br />

    tf.keras.backend.stop_gradient(
        variables
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `variables` | Tensor or list of tensors to consider constant with respect to any other variable. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A single tensor or a list of tensors (depending on the passed argument) that has no gradient with respect to any other variable. ||

<br />