Skip to content

Commit 456674b

Browse files
committed
update to reuse dpctl function
1 parent 00f4830 commit 456674b

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

dpnp/dpnp_iface.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
import dpctl
4444
import dpctl.tensor as dpt
45+
import dpctl.tensor._tensor_impl as ti
4546
import numpy
4647
from dpctl.tensor._device import normalize_queue_device
4748

@@ -163,30 +164,10 @@ def are_same_logical_tensors(ar1, ar2):
163164
False
164165
165166
"""
166-
check_supported_arrays_type(ar1, ar2)
167-
# Same ndim
168-
nd1 = ar1.ndim
169-
if nd1 != ar2.ndim:
170-
return False
171-
172-
# Same dtype
173-
if ar1.dtype != ar2.dtype:
174-
return False
175167

176-
# Same pointer
177-
if ar1.get_array()._pointer != ar2.get_array()._pointer:
178-
return False
179-
180-
# Same shape
181-
if ar1.shape != ar2.shape:
182-
return False
183-
184-
# Same strides
185-
if ar1.strides != ar2.strides:
186-
return False
187-
188-
# All checks passed: arrays are logical views into the same memory
189-
return True
168+
return ti._same_logical_tensors(
169+
dpnp.get_usm_ndarray(ar1), dpnp.get_usm_ndarray(ar2)
170+
)
190171

191172

192173
def array_equal(a1, a2, equal_nan=False):

0 commit comments

Comments
 (0)