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

torch frontend multi_dot function added #11952 #13047

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions ivy/functional/frontends/torch/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,8 @@ def vander(x, N=None):
output = ivy.reshape(output, (*original_shape, N))
output = ivy.astype(output, x.dtype)
return output


@to_ivy_arrays_and_back
def multi_dot(tensors, *, out=None):
return ivy.multi_dot(tensors,out=out)
25 changes: 25 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,3 +1147,28 @@ def test_torch_vander(
test_flags=test_flags,
x=x[0], N=N
)

#multi_dot

@handle_frontend_test(
fn_tree="torch.linalg.multi_dot",
dtype_and_input=_vander_helper(),
)
def test_torch_multi_dot(
*,
dtype_and_input,
frontend,
fn_tree,
on_device,
test_flags,
):
input_dtype, x, N = dtype_and_input
test_flags.num_positional_args = 1
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
fn_tree=fn_tree,
on_device=on_device,
test_flags=test_flags,
x=x[0], N=N
)