Skip to content

Commit

Permalink
Fix compatibility with latest cupy. (#8129)
Browse files Browse the repository at this point in the history
* Fix compatibility with latest cupy.

* Freeze mypy.
  • Loading branch information
trivialfis authored Aug 1, 2022
1 parent 24c2373 commit 2cba1d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions python-package/xgboost/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,9 @@ def _is_cudf_ser(data: DataType) -> bool:


def _is_cupy_array(data: DataType) -> bool:
return lazy_isinstance(data, "cupy.core.core", "ndarray") or lazy_isinstance(
data, "cupy._core.core", "ndarray"
return any(
lazy_isinstance(data, n, "ndarray")
for n in ("cupy.core.core", "cupy", "cupy._core.core")
)


Expand Down
2 changes: 1 addition & 1 deletion tests/ci_build/conda_env/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- pylint
- wheel
- setuptools
- mypy
- mypy=0.961
- numpy
- scipy
- pandas
Expand Down

0 comments on commit 2cba1d9

Please sign in to comment.