Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gh-1843 #1844

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading