tf.identity

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

Used in the notebooks

Used in the guide Used in the tutorials

The return value is not the same Tensor as the original, but contains the same values. This operation is fast when used on the same device.

For example:

a = tf.constant([0.78])
a_identity = tf.identity(a)
a.numpy()
array([0.78