Skip to content

Commit

Permalink
Added log10 to ivy paddle frontend (#16507) (#16528)
Browse files Browse the repository at this point in the history
* added log10 frontend implementation

* linting error fixed
  • Loading branch information
JagjeetSunghera authored Jun 12, 2023
1 parent aa686b9 commit a201fb1
Show file tree
Hide file tree
Showing 2 changed files with 37 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 @@ -133,3 +133,7 @@ def cos(self, name=None):
@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
def exp(self, name=None):
return ivy.exp(self._ivy_array)

@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
def log10(self, name=None):
return ivy.log10(self._ivy_array)
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,36 @@ def test_paddle_cos(
frontend=frontend,
on_device=on_device,
)


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

Please sign in to comment.