Skip to content

Commit

Permalink
fix: fixed rad2deg for all the backend (#28131)
Browse files Browse the repository at this point in the history
fixed rad2deg that it's not able to convert int dtype on tf to egertensor
  • Loading branch information
samthakur587 authored Jan 30, 2024
1 parent 30f6366 commit 3eaf4da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions ivy/functional/backends/tensorflow/elementwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ def deg2rad(
return radians


@with_supported_dtypes({"2.15.0 and below": ("float",)}, backend_version)
def rad2deg(
x: Union[tf.Tensor, tf.Variable],
/,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1636,16 +1636,16 @@ def test_pow(*, dtype_and_x, test_flags, backend_fw, fn_name, on_device):

@handle_test(
fn_tree="functional.ivy.rad2deg",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("numeric")
),
dtype_and_x=helpers.dtype_and_values(available_dtypes=helpers.get_dtypes("valid")),
)
def test_rad2deg(*, dtype_and_x, test_flags, backend_fw, fn_name, on_device):
input_dtype, x = dtype_and_x
helpers.test_function(
input_dtypes=input_dtype,
test_flags=test_flags,
backend_to_test=backend_fw,
rtol_=1e-2,
atol_=1e-2,
fn_name=fn_name,
on_device=on_device,
x=x[0],
Expand Down

0 comments on commit 3eaf4da

Please sign in to comment.