Skip to content

Commit 8e2fc81

Browse files
ndgrigorianoleksandr-pavlyk
authored andcommitted
Adds message to ValueError for cast of binary in-place operator where both inputs are broadcast to a new shape
1 parent c92fd6d commit 8e2fc81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dpctl/tensor/_elementwise_common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,14 @@ def _inplace_op(self, o1, o2):
976976
"operands could not be broadcast together with shapes "
977977
f"{o1_shape} and {o2_shape}"
978978
)
979+
979980
if res_shape != o1_shape:
980-
raise ValueError("")
981+
raise ValueError(
982+
"The shape of the non-broadcastable left-hand "
983+
f"side {o1_shape} is inconsistent with the "
984+
f"broadcast shape {res_shape}."
985+
)
986+
981987
sycl_dev = exec_q.sycl_device
982988
o1_dtype = o1.dtype
983989
o2_dtype = _get_dtype(o2, sycl_dev)

0 commit comments

Comments
 (0)