ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more


Utility function to build TensorInfo proto from a Tensor. (deprecated)

Migrate to TF2

This API is not compatible with eager execution as tensor needs to be a graph tensor, and there is no replacement for it in TensorFlow 2.x. To start writing programs using TensorFlow 2.x, please refer to the Effective TensorFlow 2 guide.


tensor Tensor or SparseTensor whose name, dtype and shape are used to build the TensorInfo. For SparseTensors, the names of the three constituent Tensors are used.

A TensorInfo protocol buffer constructed based on the supplied argument.

RuntimeError If eager execution is enabled.