File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed
Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change 2626
2727from merlin .core .compat import HAS_GPU
2828
29- try :
30- import cudf
31- import cupy as cp
32- import dask_cudf
33- import rmm
34- from cudf .core .column import as_column , build_column
29+ cp = None
30+ cudf = None
31+ rmm = None
3532
33+ if HAS_GPU :
3634 try :
37- # cudf >= 21.08
38- from cudf .api .types import is_list_dtype as cudf_is_list_dtype
39- from cudf .api .types import is_string_dtype as cudf_is_string_dtype
35+ import cudf
36+ import cupy as cp
37+ import dask_cudf
38+ import rmm
39+ from cudf .core .column import as_column , build_column
40+
41+ try :
42+ # cudf >= 21.08
43+ from cudf .api .types import is_list_dtype as cudf_is_list_dtype
44+ from cudf .api .types import is_string_dtype as cudf_is_string_dtype
45+ except ImportError :
46+ # cudf < 21.08
47+ from cudf .utils .dtypes import is_list_dtype as cudf_is_list_dtype
48+ from cudf .utils .dtypes import is_string_dtype as cudf_is_string_dtype
49+
4050 except ImportError :
41- # cudf < 21.08
42- from cudf .utils .dtypes import is_list_dtype as cudf_is_list_dtype
43- from cudf .utils .dtypes import is_string_dtype as cudf_is_string_dtype
51+ pass
4452
45- except ImportError :
46- cp = None
47- cudf = None
48- rmm = None
4953
5054try :
5155 # Dask >= 2021.5.1
You can’t perform that action at this time.
0 commit comments