Repository: ivy-llc/ivy

Issue:
solve
### Bug Explanation

The `paddle.linalg.solve` tests are failing. The tests and the front-end function are not implemented properly.
The test should generate two matrices of shape [ *, M, M ] and [ *, M, K ] but the written test just generates two matrices of the same shape, and function arguments are mismatched returning 
`TypeError: solve() got an unexpected keyword argument 'x'`

### Steps to Reproduce Bug

Run : `pytest ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_linalg.py::test_paddle_solve`

### Environment

MacOs : 13.5

### Ivy Version

 0.0.0.0.0

### Backend

- [ ] NumPy
- [ ] TensorFlow
- [ ] PyTorch
- [ ] JAX

### Device

Mac M1


Discussion:
@satakshigarg   I have found the fix as well
Thank you @dhanush-2501 for sharing the bug. Could you please share the high level overview of the fix, so that I can get a better idea about it ?
@satakshigarg it's very simple. We need to generate two different arrays of shape [*,M,M] and [*, M, k] and have to pass it. The current approach just generates two arrays of the same shape that's the cause of the error.
Hi @dhanush-2501 , you are right, both the test and implementation have some bugs in them. I have reopened the ToDo list item and assigned this issue to it. You can work on it if you want. Please be careful when implementing the test so that you generate only valid equation systems. You can get some inspiration in the analogous tests in other frameworks. You may also find some useful helper functions in ivy_tests/test_ivy/helpers/hypothesis_helpers/array_helpers.py.

Thank you for your interest in Ivy and sorry for the late reply :)
This issue is being closed as the function implementation is already present.
          Thanks for contributing so far.
          Feel free to look at other issues if you want to contribute further ✌️
Hello @ReneFabricius , could you please reopen this issue named 'solve'. This issue is seen as completed (ivy-leaves tagged it as completed and closed) but when I checked the code (function, relevant tests), and ran the tests, the tests still fails. The code is not updated as per the above discussion thread.

Thank you.
Thanks @dhanush-2501 for mentioning the failing tests 😃
Feel free to ping us when you feel it's ready.
Thank you !!

Resolving patch:
diff --git a/ivy/functional/frontends/paddle/tensor/linalg.py b/ivy/functional/frontends/paddle/tensor/linalg.py
--- a/ivy/functional/frontends/paddle/tensor/linalg.py
+++ b/ivy/functional/frontends/paddle/tensor/linalg.py
@@ -183,10 +183,10 @@ def qr(x, mode="reduced", name=None):
 
 
 # solve
-@with_unsupported_dtypes({"2.5.1 and below": ("float16", "bfloat16")}, "paddle")
+@with_supported_dtypes({"2.5.1 and below": ("float32", "float64")}, "paddle")
 @to_ivy_arrays_and_back
-def solve(x1, x2, name=None):
-    return ivy.solve(x1, x2)
+def solve(x, y, name=None):
+    return ivy.solve(x, y)
 
 
 # transpose


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_linalg.py b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_linalg.py
--- a/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_linalg.py
+++ b/ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_linalg.py
@@ -12,6 +12,7 @@
 )
 
 from ivy_tests.test_ivy.test_frontends.test_tensorflow.test_linalg import (
+    _get_first_matrix,
     _get_second_matrix,
     _get_cholesky_matrix,
 )
@@ -872,36 +873,35 @@ def test_paddle_qr(
 
 # 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"],
+    fn_tree="paddle.tensor.linalg.solve",
+    aliases=["paddle.linalg.solve"],
+    x=_get_first_matrix(),
+    y=_get_second_matrix(),
     test_with_out=st.just(False),
 )
 def test_paddle_solve(
     *,
-    dtype_x,
+    x,
+    y,
     frontend,
-    test_flags,
     backend_fw,
+    test_flags,
     fn_tree,
     on_device,
 ):
-    input_dtype, x = dtype_x
+    input_dtype1, x1 = x
+    input_dtype2, x2 = y
     helpers.test_frontend_function(
-        input_dtypes=input_dtype,
-        frontend=frontend,
+        input_dtypes=[input_dtype1, input_dtype2],
         backend_to_test=backend_fw,
+        frontend=frontend,
         test_flags=test_flags,
         fn_tree=fn_tree,
         on_device=on_device,
-        x=x[0],
-        y=x[1],
+        rtol=1e-3,
+        atol=1e-3,
+        x=x1,
+        y=x2,
     )