# tf.compat.v1.saved_model.build_tensor_info

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/saved_model/utils_impl.py#L44-L67) |

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

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.compat.v1.saved_model.build_tensor_info(
        tensor
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.utils.build_tensor_info or tf.compat.v1.saved_model.build_tensor_info.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `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. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A TensorInfo protocol buffer constructed based on the supplied argument. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `RuntimeError` | If eager execution is enabled. |

<br />