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
This commit is contained in:
Skye Wanderman-Milne 2018-06-20 15:26:13 -07:00 committed by TensorFlower Gardener
parent 1f4a7264c8
commit 6caf20322c
3 changed files with 3 additions and 9 deletions
tensorflow
contrib/cmake
python
client
kernel_tests/random

View File

@ -229,8 +229,6 @@ if (tensorflow_BUILD_PYTHON_TESTS)
"${tensorflow_source_dir}/tensorflow/python/debug/cli/profile_analyzer_cli_test.py"
# Windows does not have the curses library and uses readline.
"${tensorflow_source_dir}/tensorflow/python/debug/cli/curses_ui_test.py"
# Bug in shape inference (b/110283809)
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/random/random_ops_test.py"
# TFDBG grpc:// mode is not yet available on Windows.
"${tensorflow_source_dir}/tensorflow/python/debug/lib/dist_session_debug_grpc_test.py"
"${tensorflow_source_dir}/tensorflow/python/debug/lib/grpc_large_data_test.py"

View File

@ -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]));
}
}

View File

@ -88,10 +88,6 @@ cuda_py_test(
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:random_ops",
],
tags = [
"manual",
"no_oss",
],
)
cuda_py_test(