aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/python_api.h
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-03-23 16:28:16 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-25 04:27:22 -0700
commit202e4f3b3699e8e40e478402462f76ae853fecbf (patch)
tree9ce7c041c1d78ff4704d7c0752a7ea074b2d1a40 /tensorflow/c/python_api.h
parent97249979d9a76ae05d590f9cbe199c0b47712b4f (diff)
Make _USE_C_API = True and _USE_C_SHAPES = False work with handle data.
This change makes _set_shapes_for_outputs_c_api fetch and set Tensor._handle_data. This is necessary for running the Python shape inference code on resource tensors. PiperOrigin-RevId: 190293303
Diffstat (limited to 'tensorflow/c/python_api.h')
-rw-r--r--tensorflow/c/python_api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/c/python_api.h b/tensorflow/c/python_api.h
index 13b680b3a2..2d4c8cd9ed 100644
--- a/tensorflow/c/python_api.h
+++ b/tensorflow/c/python_api.h
@@ -16,6 +16,8 @@ limitations under the License.
#ifndef TENSORFLOW_C_PYTHON_API_H_
#define TENSORFLOW_C_PYTHON_API_H_
+#include <string>
+
#include "tensorflow/c/c_api.h"
// These functions can be removed without notice. They exist to facilitate some
@@ -51,6 +53,11 @@ void SetRequireShapeInferenceFns(TF_Graph* graph, bool require);
// the graph after the session has been made aware of them.
void ExtendSession(TF_Session* session, TF_Status* status);
+// Returns the serialized CppShapeInferenceResult::HandleData proto for
+// `output` if its a resource tensor, or otherwise returns the empty string.
+// TODO(b/74620627): remove when _USE_C_SHAPES is removed
+std::string ResourceHandleShapeAndType(TF_Graph* graph, TF_Output output);
+
} // namespace tensorflow
#endif // TENSORFLOW_C_PYTHON_API_H_