Skip to content

Commit 4eba18a

Browse files
committed
Use ndarray.data.ptr in the tests
1 parent 7918bcf commit 4eba18a

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

dpnp/tests/test_dlpack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_device(self):
7878
x = dpnp.arange(5)
7979
y = dpnp.from_dlpack(x, device=x.__dlpack_device__())
8080
assert x.device == y.device
81-
assert x.get_array()._pointer == y.get_array()._pointer
81+
assert x.data.ptr == y.data.ptr
8282

8383
def test_numpy_input(self):
8484
x = numpy.arange(10)

dpnp/tests/third_party/cupy/linalg_tests/test_einsum.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,7 @@ def test_einsum_unary_views(self, xp, dtype):
359359
a = testing.shaped_arange(self.shape_a, xp, dtype)
360360
b = xp.einsum(self.subscripts, a)
361361
if xp is cupy:
362-
return (
363-
b.ndim == 0 or b.get_array()._pointer == a.get_array()._pointer
364-
)
362+
return b.ndim == 0 or b.data.ptr == a.data.ptr
365363
return b.ndim == 0 or b.base is a
366364

367365
@testing.for_all_dtypes_combination(

dpnp/tests/third_party/cupy/manipulation_tests/test_shape.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_reshape_zerosize(self, xp):
103103
a = xp.zeros((0,))
104104
b = a.reshape((0,))
105105
if xp is cupy:
106-
assert a.get_array()._pointer == b.get_array()._pointer
106+
assert a.data.ptr == b.data.ptr
107107
else:
108108
assert b.base is a
109109
return b
@@ -114,7 +114,7 @@ def test_reshape_zerosize2(self, xp, order):
114114
a = xp.zeros((2, 0, 3))
115115
b = a.reshape((5, 0, 4), order=order)
116116
if xp is cupy:
117-
assert a.get_array()._pointer == b.get_array()._pointer
117+
assert a.data.ptr == b.data.ptr
118118
else:
119119
assert b.base is a
120120
return b

0 commit comments

Comments
 (0)