aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/client/tf_session.i
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/client/tf_session.i')
-rw-r--r--tensorflow/python/client/tf_session.i10
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/python/client/tf_session.i b/tensorflow/python/client/tf_session.i
index 40731aba7d..f45bc13602 100644
--- a/tensorflow/python/client/tf_session.i
+++ b/tensorflow/python/client/tf_session.i
@@ -344,6 +344,16 @@ bool PyTensorListToVector(PyObject* py_tensor_list,
%rename("_TF_SetConfig") TF_SetConfig;
%rename("_TF_NewSessionOptions") TF_NewSessionOptions;
+// Create temporary int64_t to pass to TF_OperationGetAttrInt
+%typemap(in, numinputs=0) int64_t* value (int64_t val) {
+ $1 = &val;
+}
+
+// Convert value to Python int
+%typemap(argout) int64_t* value {
+ $result = PyInt_FromLong(*$1);
+}
+
%include "tensorflow/c/c_api.h"
%include "tensorflow/c/python_api.h"