Skip to content

Commit

Permalink
added paddle frontend tensor instance angle method (#17914)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosesdaudu001 authored Jun 27, 2023
1 parent 5f2acae commit d386d83
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ivy/functional/frontends/paddle/tensor/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,10 @@ def cumprod(self, dim=None, dtype=None, name=None):
@with_unsupported_dtypes({"2.5.0 and below": ("float16", "bfloat16")}, "paddle")
def cumsum(self, axis=None, dtype=None, name=None):
return ivy.cumsum(self._ivy_array, axis=axis, dtype=dtype)

@with_supported_dtypes(
{"2.5.0 and below": ("complex64", "complex128", "float32", "float64")},
"paddle",
)
def angle(self, name=None):
return ivy.angle(self._ivy_array)
Original file line number Diff line number Diff line change
Expand Up @@ -1522,3 +1522,35 @@ def test_paddle_cumsum(
frontend=frontend,
on_device=on_device,
)


@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="paddle.to_tensor",
method_name="angle",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=["float64", "complex64", "complex128"],
),
)
def test_paddle_angle(
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 d386d83

Please sign in to comment.