Skip to content

Commit

Permalink
ENH: asinh added in paddle.tensor asinh #16097 (#16100)
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadNizamani authored Jun 2, 2023
1 parent 94770e7 commit 9c10b3a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def dim(self):
def abs(self):
return paddle_frontend.abs(self)

@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
def asinh(self, name=None):
return ivy.asinh(self._ivy_array)

@with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
def asin(self, name=None):
return ivy.asin(self._ivy_array)
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ def test_torch_instance_abs(
)




# asin
@handle_frontend_method(
class_tree=CLASS_TREE,
Expand Down Expand Up @@ -309,3 +311,36 @@ def test_paddle_asin(
frontend=frontend,
on_device=on_device,
)

# asinh
@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="asinh",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
),
)
def test_paddle_asinh(
dtype_and_x,
frontend_method_data,
init_flags,
method_flags,
frontend,
on_device,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_method(
init_input_dtypes=input_dtype,
init_all_as_kwargs_np={
"data": x[0],
},
method_input_dtypes=input_dtype,
method_all_as_kwargs_np={},
frontend_method_data=frontend_method_data,
init_flags=init_flags,
method_flags=method_flags,
frontend=frontend,
on_device=on_device,
)

0 comments on commit 9c10b3a

Please sign in to comment.