Skip to content

Commit

Permalink
feat: added log10 function in paddle frontend (ivy-llc#24461)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokshmalik5757 authored and iababio committed Sep 27, 2023
1 parent fff453a commit 6087327
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ivy/functional/frontends/paddle/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ def log1p(x, name=None):
def log2(x, name=None):
return ivy.log2(x)

@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
def log10(x, name=None):
return ivy.log10(x)


@with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
@to_ivy_arrays_and_back
Expand Down
26 changes: 26 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_paddle/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,32 @@ def test_paddle_log2(
x=x[0],
)

@handle_frontend_test(
fn_tree="paddle.log10",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("valid"),
),
)
def test_paddle_log10(
*,
dtype_and_x,
on_device,
fn_tree,
frontend,
backend_fw,
test_flags,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
backend_to_test=backend_fw,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
x=x[0],
)


# logit
@handle_frontend_test(
Expand Down

0 comments on commit 6087327

Please sign in to comment.