# tf.keras.backend.print_tensor

<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/print_tensor) | [![](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#L3366-L3394) |

Prints `message` and the tensor value when evaluated.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.keras.backend.print_tensor(
        x, message=''
    )

Note that `print_tensor` returns a new tensor identical to `x`
which should be used in the following code. Otherwise the
print operation is not taken into account during evaluation.

#### Example:

       x = K.print_tensor(x, message="x is: ")

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `x` | Tensor to print. |
| `message` | Message to print jointly with the tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The same tensor `x`, unchanged. ||

<br />