ivy-llc / ivy

Convert Machine Learning Code Between Frameworks
https://ivy.dev
Other
14.02k stars 5.74k forks source link

Fix Frontend Failing Test: torch - blas_and_lapack_ops.svd #28769

Open Daniel4078 opened 5 months ago

Daniel4078 commented 5 months ago

Now the failing tests shows that the ground truth is somehow thought to be all zeros, while the parameters of some = False, compute = False cause the full_matrices to be computed while zero-filled tensors should be returned for U and V (according to torch documentation https://pytorch.org/docs/stable/generated/torch.svd.html)

Daniel4078 commented 5 months ago

But according to the same documentation, the output should be a tuple of (U, S, V), instead of the current supposed ground truth of (U, V) (as shown here https://github.com/Transpile-AI/ivy/actions/runs/9589504921/job/26443403485#step:6:127). So I believe the current implementations of the torch.svd and the test are both wrong.

Daniel4078 commented 5 months ago

Currently, both svd function in torch frontend have certain behaviors unimplemented, so will start working on that first.

Daniel4078 commented 5 months ago

Also found that the backend implementation of torch.linear_algebra.svd does not produce the namedtuple output of (U,S,Vh) as described by the ivy function svd when compute_uv is false.