# tf.identity

<br />

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

Return a tensor with the same shape and contents as input.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.identity(
        input, name=None
    )

#### For example:

    import tensorflow as tf
    val0 = tf.ones((1,), dtype=tf.float32)
    a = tf.atan2(val0, val0)
    a_identity = tf.identity(a)
    print(a.numpy())          #[0.7853982]
    print(a_identity.numpy()) #[0.7853982]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `input` | A `Tensor`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor`. Has the same type as `input`. ||

<br />