diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index cd028ba0bedf..d0ffb7957336 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -2307,7 +2307,7 @@ def inplace_predict( _array_interface(csr.indptr), _array_interface(csr.indices), _array_interface(csr.data), - ctypes.c_size_t(csr.shape[1]), + c_bst_ulong(csr.shape[1]), from_pystr_to_cstr(json.dumps(args)), p_handle, ctypes.byref(shape), diff --git a/python-package/xgboost/data.py b/python-package/xgboost/data.py index e486fb57a5f5..775eedd5776f 100644 --- a/python-package/xgboost/data.py +++ b/python-package/xgboost/data.py @@ -103,7 +103,7 @@ def _from_scipy_csr( _array_interface(data.indptr), _array_interface(data.indices), _array_interface(data.data), - ctypes.c_size_t(data.shape[1]), + c_bst_ulong(data.shape[1]), config, ctypes.byref(handle), )