File tree Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change 42
42
43
43
import dpctl
44
44
import dpctl .tensor as dpt
45
+ import dpctl .tensor ._tensor_impl as ti
45
46
import numpy
46
47
from dpctl .tensor ._device import normalize_queue_device
47
48
@@ -163,30 +164,10 @@ def are_same_logical_tensors(ar1, ar2):
163
164
False
164
165
165
166
"""
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
175
167
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
+ )
190
171
191
172
192
173
def array_equal (a1 , a2 , equal_nan = False ):
You can’t perform that action at this time.
0 commit comments