Skip to content

Commit 02cf24c

Browse files
author
Vahid Tavanashad
committed
address comments
1 parent fc57152 commit 02cf24c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dpnp/dpnp_utils/dpnp_utils_linearalgebra.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,14 @@ def _get_result_shape_multiplication(x1, x2, func):
327327
else:
328328
_shape_error(x1_shape, x2_shape, func, err_msg=1)
329329

330+
result_shape = tuple(tmp_shape)
330331
if func == "matvec":
331-
result_shape = tuple(tmp_shape) + (x1.shape[-2],)
332+
result_shape += (x1.shape[-2],)
332333
elif func == "vecmat":
333-
result_shape = tuple(tmp_shape) + (x2.shape[-1],)
334+
result_shape += (x2.shape[-1],)
334335
else:
335336
assert func == "matmul"
336-
result_shape = tuple(tmp_shape) + (x1.shape[-2], x2.shape[-1])
337+
result_shape += (x1.shape[-2], x2.shape[-1])
337338

338339
return x1, x2, result_shape
339340

@@ -851,6 +852,9 @@ def dpnp_multiplication(
851852

852853
if axis is not None:
853854
signature, distinct_core = _get_signature(func)
855+
# "matmul," "matvec," and "vecmat" always have multiple distinct cores,
856+
# and `axis` is not supported for these functions.
857+
# Therefore, raise an error in all cases where `axis` is provided.
854858
raise TypeError(
855859
f"{func}: axis can only be used with a single shared core "
856860
f"dimension, not with the {distinct_core} distinct ones implied "

0 commit comments

Comments
 (0)