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_rad2deg #8528

Merged
merged 1 commit into from
Dec 16, 2022
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
4 changes: 4 additions & 0 deletions ivy/functional/frontends/torch/pointwise_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,7 @@ def logaddexp2(x1, x2, out=None):
@with_unsupported_dtypes({"1.11.0 and below": ("float16",)}, "torch")
def i0(x, out=None):
return ivy.i0(x, out=out)


def rad2deg(input, *, out=None):
return ivy.rad2deg(input, out=out)
38 changes: 38 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_torch/test_pointwise_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,3 +2180,41 @@ def test_torch_i0(
rtol=1e-05,
x=x[0],
)


# rad2deg
@handle_frontend_test(
fn_tree="torch.rad2deg",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=2,
shared_dtype=True,
max_dim_size=3,
max_num_dims=3,
min_dim_size=1,
min_num_dims=1
),
)
def test_torch_rad2deg(
*,
dtype_and_x,
as_variable,
with_out,
num_positional_args,
native_array,
on_device,
fn_tree,
frontend,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
as_variable_flags=as_variable,
with_out=with_out,
num_positional_args=num_positional_args,
native_array_flags=native_array,
frontend=frontend,
fn_tree=fn_tree,
on_device=on_device,
input=x[0],
)