From e43cd60c0ea298edc87ffeb96f9e638a0a8fda03 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Wed, 26 Oct 2022 20:47:16 +0800 Subject: [PATCH] [backport] Type fix for WebAssembly. (#8369) (#8394) Co-authored-by: Yizhi Liu --- python-package/xgboost/core.py | 2 +- python-package/xgboost/data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 633cce452ca4..aa5014c29d11 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -2308,7 +2308,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), )