From 56a1d2a864f54585f2f6d05d2cbdc6283021ebb9 Mon Sep 17 00:00:00 2001 From: Mit Kotak Date: Fri, 24 Jun 2022 13:22:42 -0500 Subject: [PATCH] np.asscalar -> np.ndarray.item --- pycuda/gpuarray.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pycuda/gpuarray.py b/pycuda/gpuarray.py index 36a39dc3..a3dbc100 100644 --- a/pycuda/gpuarray.py +++ b/pycuda/gpuarray.py @@ -211,7 +211,7 @@ class GPUArray: except TypeError: # handle dim-0 ndarrays: if isinstance(shape, np.ndarray): - shape = np.asscalar(shape) + shape = shape.item() assert isinstance(shape, numbers.Integral) s = shape shape = (shape,) @@ -221,7 +221,7 @@ class GPUArray: if isinstance(s, np.integer): # bombs if s is a Python integer - s = np.asscalar(s) + s = s.item() if strides is None: if order == "F": -- GitLab