diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-06-20 15:26:13 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-06-20 15:33:58 -0700 |
commit | 6caf20322cba22092a96ce961ed1cf5d7324df8a (patch) | |
tree | b1091b830f7da224fb9535ec8194f331fbc72fc1 /tensorflow/python/client | |
parent | 1f4a7264c8d374620320763148709aae43cb21ad (diff) |
Use PyLong_FromLongLong to convert 64-bit ints in SWIG code.
On some platforms (namely Windows), a long is 32 bits, not 64.
This is what was causing random_ops_test to fail on Winodws.
PiperOrigin-RevId: 201427591
Diffstat (limited to 'tensorflow/python/client')
-rw-r--r-- | tensorflow/python/client/tf_session.i | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/python/client/tf_session.i b/tensorflow/python/client/tf_session.i index def730371d..985cb90436 100644 --- a/tensorflow/python/client/tf_session.i +++ b/tensorflow/python/client/tf_session.i @@ -135,7 +135,7 @@ tensorflow::ImportNumpy(); // Convert TF_DeviceListMemoryBytes and TF_Dim int64_t output to Python integers %typemap(out) int64_t { - $result = PyInt_FromLong($1); + $result = PyLong_FromLongLong($1); } // We use TF_OperationGetControlInputs_wrapper instead of @@ -610,7 +610,7 @@ def TF_Reset(target, containers=None, config=None): } for (size_t i = 0; i < $1.size(); ++i) { - PyList_SET_ITEM($result, i, PyLong_FromLong($1[i])); + PyList_SET_ITEM($result, i, PyLong_FromLongLong($1[i])); } } @@ -673,7 +673,7 @@ def TF_Reset(target, containers=None, config=None): } for (size_t i = 0; i < $1.size(); ++i) { - PyList_SET_ITEM($result, i, PyInt_FromLong($1[i])); + PyList_SET_ITEM($result, i, PyLong_FromLongLong($1[i])); } } |