Skip to content

Commit

Permalink
solve-paddle-frontend (#17092)
Browse files Browse the repository at this point in the history
  • Loading branch information
selvaraj-sembulingam authored Jun 20, 2023
1 parent f844d6c commit f71bfb2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ivy/functional/frontends/paddle/tensor/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ def pinv(x, rcond=1e-15, hermitian=False, name=None):
return ivy.pinv(x, rtol=rcond)


# solve
@with_unsupported_dtypes({"2.4.2 and below": ("float16", "bfloat16")}, "paddle")
@to_ivy_arrays_and_back
def solve(x1, x2, name=None):
return ivy.solve(x1, x2)


# cholesky
@with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
@to_ivy_arrays_and_back
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,39 @@ def test_paddle_pinv(
)


# solve
@handle_frontend_test(
fn_tree="paddle.solve",
dtype_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=2,
shared_dtype=True,
min_value=-10,
max_value=10,
),
aliases=["paddle.tensor.linalg.solve"],
test_with_out=st.just(False),
)
def test_paddle_solve(
*,
dtype_x,
frontend,
test_flags,
fn_tree,
on_device,
):
input_dtype, x = dtype_x
helpers.test_frontend_function(
input_dtypes=input_dtype,
frontend=frontend,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
x=x[0],
y=x[1],
)


# cholesky
@handle_frontend_test(
fn_tree="paddle.tensor.linalg.cholesky",
Expand Down

0 comments on commit f71bfb2

Please sign in to comment.