Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add cov to the paddle frontend #28603

Merged
merged 6 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ivy/functional/frontends/paddle/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def cond(x, p=None, name=None):
return ret


# cov
@with_supported_dtypes(
{"2.6.1 and below": ("complex64", "complex128", "float32", "float64")}, "paddle"
)
@to_ivy_arrays_and_back
def cov(x, rowvar=True, ddof=True, fweights=None, aweights=None, name=None):
return ivy.cov(x, rowVar=rowvar, ddof=ddof, fweights=fweights, aweights=aweights)


@with_supported_dtypes(
{"2.6.0 and below": ("float32", "float64", "int32", "int64")}, "paddle"
)
Expand Down
34 changes: 34 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_paddle/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,40 @@ def test_paddle_cond(
)


# cov
@handle_frontend_test(
fn_tree="paddle.linalg.cov",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=1,
max_num_dims=2,
),
rowvar=st.booleans(),
ddof=st.booleans(),
)
def test_paddle_cov(
*,
dtype_and_x,
rowvar,
ddof,
frontend,
test_flags,
fn_tree,
backend_fw,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
test_flags=test_flags,
backend_to_test=backend_fw,
fn_tree=fn_tree,
x=x,
rowvar=rowvar,
ddof=ddof,
)


# Tests #
# ----- #

Expand Down
Loading