3 #include <torch/csrc/python_headers.h> 4 #include <torch/csrc/Exceptions.h> 5 #include <torch/csrc/utils/object_ptr.h> 6 #include <torch/csrc/utils/python_numbers.h> 8 inline void THPUtils_packInt64Array(PyObject *tuple,
size_t size,
const int64_t *sizes) {
9 for (
size_t i = 0; i != size; ++i) {
10 PyObject *i64 = THPUtils_packInt64(sizes[i]);
14 PyTuple_SET_ITEM(tuple, i, i64);
18 inline PyObject* THPUtils_packInt64Array(
size_t size,
const int64_t *sizes) {
21 THPUtils_packInt64Array(tuple.get(), size, sizes);
22 return tuple.release();