Skip to content

Commit

Permalink
EHN: function outer is added in math.py (#18560)
Browse files Browse the repository at this point in the history
Co-authored-by: Ookamice <[email protected]>
  • Loading branch information
MuhammadNizamani and Ookamice authored Jul 18, 2023
1 parent 92e9ed6 commit c7e8715
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ivy/functional/frontends/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ def sgn(x, name=None):
return ivy.sign(x, np_variant=True)


@with_supported_dtypes({"2.5.0 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
def outer(x, y, name=None):
return ivy.outer(x, y)


# maximum
@with_unsupported_dtypes({"2.5.0 and below": ("float16", "bfloat16")}, "paddle")
@to_ivy_arrays_and_back
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1502,3 +1502,34 @@ def test_paddle_lerp(
y=x[1],
weight=x[2],
)


# outer
@handle_frontend_test(
fn_tree="paddle.tensor.math.outer",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("valid"),
num_arrays=2,
min_num_dims=1,
max_num_dims=1,
shared_dtype=True,
),
)
def test_paddle_outer(
*,
dtype_and_x,
on_device,
fn_tree,
frontend,
test_flags,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
fn_tree=fn_tree,
test_flags=test_flags,
on_device=on_device,
x=x[0],
y=x[1],
)

0 comments on commit c7e8715

Please sign in to comment.