Skip to content

Commit 14132c4

Browse files
committed
reorder array type check
1 parent 910b38b commit 14132c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

xrspatial/utils.py

100644100755
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ def __init__(self, numpy_func, cupy_func, dask_func, dask_cupy_func):
8282

8383
def __call__(self, arr):
8484

85-
# cupy case
86-
if has_cuda() and isinstance(arr.data, cupy.ndarray):
87-
return self.cupy_func
88-
8985
# numpy case
90-
elif isinstance(arr.data, np.ndarray):
86+
if isinstance(arr.data, np.ndarray):
9187
return self.numpy_func
9288

89+
# cupy case
90+
elif has_cuda() and isinstance(arr.data, cupy.ndarray):
91+
return self.cupy_func
92+
9393
# dask + cupy case
9494
elif has_cuda() and is_dask_cupy(arr):
9595
return self.dask_cupy_func

0 commit comments

Comments
 (0)