Skip to content

Commit

Permalink
fix gh-1843
Browse files Browse the repository at this point in the history
  • Loading branch information
vtavana committed May 22, 2024
1 parent 86c8640 commit 01e2aae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dpnp/dpnp_utils/dpnp_utils_linearalgebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ def dpnp_matmul(
if numpy.prod(result_shape) == 0:
res_shape = result_shape
elif x1_shape[-1] == 1:
call_flag = "kron"
call_flag = "multiply"
elif x1_is_1D and x2_is_1D:
call_flag = "dot"
x1 = dpnp.reshape(x1, x1_shape[-1])
Expand Down Expand Up @@ -2148,8 +2148,8 @@ def dpnp_matmul(
call_flag = "gemm_batch"
res_shape = result_shape

if call_flag == "kron":
res = dpnp.kron(x1, x2)
if call_flag == "multiply":
res = dpnp.multiply(x1, x2)
res_shape = res.shape
elif call_flag == "dot":
if out is not None and out.shape != ():
Expand Down
5 changes: 5 additions & 0 deletions tests/test_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,11 @@ def setup_method(self):
((10, 1, 1, 3), (2, 3, 3)),
((10, 1, 1, 3), (10, 2, 3, 3)),
((10, 2, 1, 3), (10, 2, 3, 3)),
((3, 3, 1), (3, 1, 2)),
((3, 3, 1), (1, 1, 2)),
((1, 3, 1), (3, 1, 2)),
((4, 1, 3, 1), (1, 3, 1, 2)),
((1, 3, 3, 1), (4, 1, 1, 2)),
],
)
def test_matmul(self, order_pair, shape_pair):
Expand Down

0 comments on commit 01e2aae

Please sign in to comment.