Skip to content

Commit

Permalink
Adding lgamma to paddle frontend. (ivy-llc#20269)
Browse files Browse the repository at this point in the history
Co-authored-by: Muhammad Saeed <[email protected]>
  • Loading branch information
Madjid-CH and MuhammadSaeedBatikh authored Aug 5, 2023
1 parent d170f51 commit 2c49dbf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ivy/functional/frontends/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ def neg(x, name=None):

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


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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,36 @@ def test_paddle_neg(
)


# lgamma
@handle_frontend_test(
fn_tree="paddle.tensor.math.lgamma",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
safety_factor_scale="log",
),
)
def test_paddle_lgamma(
*,
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,
atol=1E-4,
x=x[0],
)


# exp
@handle_frontend_test(
fn_tree="paddle.exp",
Expand Down

0 comments on commit 2c49dbf

Please sign in to comment.