Skip to content

Commit

Permalink
fix gh-1843 (#1844)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
  • Loading branch information
vtavana and antonwolfy authored May 22, 2024
1 parent b988e9c commit 069cad2
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 @@ -2180,6 +2180,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 069cad2

Please sign in to comment.