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:
parent
1f4a7264c8
commit
6caf20322c
@ -229,8 +229,6 @@ if (tensorflow_BUILD_PYTHON_TESTS)
|
|||||||
"${tensorflow_source_dir}/tensorflow/python/debug/cli/profile_analyzer_cli_test.py"
|
"${tensorflow_source_dir}/tensorflow/python/debug/cli/profile_analyzer_cli_test.py"
|
||||||
# Windows does not have the curses library and uses readline.
|
# Windows does not have the curses library and uses readline.
|
||||||
"${tensorflow_source_dir}/tensorflow/python/debug/cli/curses_ui_test.py"
|
"${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.
|
# 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/dist_session_debug_grpc_test.py"
|
||||||
"${tensorflow_source_dir}/tensorflow/python/debug/lib/grpc_large_data_test.py"
|
"${tensorflow_source_dir}/tensorflow/python/debug/lib/grpc_large_data_test.py"
|
||||||
|
@ -135,7 +135,7 @@ tensorflow::ImportNumpy();
|
|||||||
|
|
||||||
// Convert TF_DeviceListMemoryBytes and TF_Dim int64_t output to Python integers
|
// Convert TF_DeviceListMemoryBytes and TF_Dim int64_t output to Python integers
|
||||||
%typemap(out) int64_t {
|
%typemap(out) int64_t {
|
||||||
$result = PyInt_FromLong($1);
|
$result = PyLong_FromLongLong($1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use TF_OperationGetControlInputs_wrapper instead of
|
// 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) {
|
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) {
|
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]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,10 +88,6 @@ cuda_py_test(
|
|||||||
"//tensorflow/python:framework_for_generated_wrappers",
|
"//tensorflow/python:framework_for_generated_wrappers",
|
||||||
"//tensorflow/python:random_ops",
|
"//tensorflow/python:random_ops",
|
||||||
],
|
],
|
||||||
tags = [
|
|
||||||
"manual",
|
|
||||||
"no_oss",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cuda_py_test(
|
cuda_py_test(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user