Type fix for WebAssembly: use bst_ulong instead of size_t for ncol in CSR conversion. (#8369)

This commit is contained in:
Yizhi Liu 2022-10-26 04:21:45 -07:00 committed by GitHub
parent a2593e60bf
commit 5699f60a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -2307,7 +2307,7 @@ class Booster:
_array_interface(csr.indptr), _array_interface(csr.indptr),
_array_interface(csr.indices), _array_interface(csr.indices),
_array_interface(csr.data), _array_interface(csr.data),
ctypes.c_size_t(csr.shape[1]), c_bst_ulong(csr.shape[1]),
from_pystr_to_cstr(json.dumps(args)), from_pystr_to_cstr(json.dumps(args)),
p_handle, p_handle,
ctypes.byref(shape), ctypes.byref(shape),

View File

@ -103,7 +103,7 @@ def _from_scipy_csr(
_array_interface(data.indptr), _array_interface(data.indptr),
_array_interface(data.indices), _array_interface(data.indices),
_array_interface(data.data), _array_interface(data.data),
ctypes.c_size_t(data.shape[1]), c_bst_ulong(data.shape[1]),
config, config,
ctypes.byref(handle), ctypes.byref(handle),
) )