A C long is 32 bits on some platforms, which can cause the
PyInt_AsLong call in PyInt64ListToVector to
overflow. large_concat_op_test exposes this bug on such platforms.
PiperOrigin-RevId:
191484167
int size = PySequence_Fast_GET_SIZE(py_int_seq);
for (int i = 0; i < size; ++i) {
PyObject* item = PySequence_Fast_GET_ITEM(py_int_seq, i);
- vec->push_back(PyInt_AsLong(item));
+ vec->push_back(PyLong_AsLongLong(item));
}
}
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
+from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.platform import test
+@test_util.with_c_api
class LargeConcatOpTest(test.TestCase):
"""Tests that belong in concat_op_test.py, but run over large tensors."""