Skip to content

Commit a71f1bb

Browse files
Use dpnp.broadcast_arrays() instead of dpnp.broadcast_shapes()
1 parent c27596f commit a71f1bb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

dpnp/dpnp_iface_logic.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,16 @@ def _isclose_scalar_tol(a, b, rtol, atol, equal_nan):
124124

125125
# pylint: disable=W0707
126126
try:
127-
res_shape = dpnp.broadcast_shapes(a.shape, b.shape)
127+
a, b = dpnp.broadcast_arrays(a, b)
128128
except ValueError:
129129
raise ValueError(
130130
"operands could not be broadcast together with shapes "
131131
f"{a.shape} and {b.shape}"
132132
)
133133

134-
if a.shape != res_shape:
135-
a = dpnp.broadcast_to(a, res_shape)
136-
if b.shape != res_shape:
137-
b = dpnp.broadcast_to(b, res_shape)
138-
139134
out_dtype = dpnp.bool
140135
output = dpnp.empty(
141-
res_shape, dtype=out_dtype, sycl_queue=exec_q, usm_type=usm_type
136+
a.shape, dtype=out_dtype, sycl_queue=exec_q, usm_type=usm_type
142137
)
143138

144139
_manager = dpu.SequentialOrderManager[exec_q]

0 commit comments

Comments
 (0)