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.
Description
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.
Returns
A TensorInfo protocol buffer constructed based on the supplied argument.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.saved_model.build_tensor_info\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/saved_model/utils_impl.py#L41-L68) |\n\nUtility function to build TensorInfo proto from a Tensor. (deprecated)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.saved_model.utils.build_tensor_info`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/saved_model/build_tensor_info)\n\n\u003cbr /\u003e\n\n tf.compat.v1.saved_model.build_tensor_info(\n tensor\n )\n\n\u003cbr /\u003e\n\nMigrate to TF2\n--------------\n\n\u003cbr /\u003e\n\n| **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.\n\nThis API is not compatible with eager execution as `tensor` needs to be a\ngraph tensor, and there is no replacement for it in TensorFlow 2.x. To start\nwriting programs using TensorFlow 2.x, please refer to the [Effective\nTensorFlow 2](https://www.tensorflow.org/guide/effective_tf2) guide.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDescription\n-----------\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: This API was designed for TensorFlow v1. See \u003chttps://www.tensorflow.org/guide/migrate\u003e for instructions on how to migrate your code to TensorFlow v2.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A TensorInfo protocol buffer constructed based on the supplied argument. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|----------------|--------------------------------|\n| `RuntimeError` | If eager execution is enabled. |\n\n\u003cbr /\u003e"]]