tf.identity  |  TensorFlow v2.0.0 (original) (raw)

tf.identity

Stay organized with collections Save and categorize content based on your preferences.

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

View aliases

Compat aliases for migration

SeeMigration guide for more details.

tf.compat.v1.identity

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]
Args
input A Tensor.
name A name for the operation (optional).
Returns
A Tensor. Has the same type as input.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2020-10-01 UTC.