Skip to content

Commit

Permalink
Merge pull request #16046 from MuhammadNizamani/asin
Browse files Browse the repository at this point in the history
EHN: asin added in paddle.tensor.tensor.Tensor class, from issue asin #16043  and form list of function #15115
  • Loading branch information
soma2000-lang authored Jun 1, 2023
2 parents 1c89fa0 + 50e3adc commit 72fcdd7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# local
import ivy
import ivy.functional.frontends.paddle as paddle_frontend
from ivy.functional.frontends.paddle.func_wrapper import _to_ivy_array
from ivy.func_wrapper import with_unsupported_dtypes
from ivy.functional.frontends.paddle.func_wrapper import (
_to_ivy_array,
)
from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes


class Tensor:
Expand Down Expand Up @@ -95,3 +97,7 @@ def dim(self):
@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
def abs(self):
return paddle_frontend.abs(self)

@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 @@ -276,3 +276,36 @@ def test_torch_instance_abs(
frontend=frontend,
on_device=on_device,
)


# asin
@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="asin",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
),
)
def test_paddle_asin(
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 72fcdd7

Please sign in to comment.