ivy
ivy copied to clipboard
feat: add lu_unpack function in Torch Frontend
PR Description
The lu_unpack function is limited to scipy, torch and paddle. As there are no backend functions implemented yet in Experimental API, I have written a custom and generic unpack for the 2D LU matrix along with the conversion of pivot indices to permutation matrix. The multi-dimensional lu_unpack is a bit more complex and cluttered in the front-end function. It's better if it is implemented in the Experimental API.
Things to highlight:
- Vectorizing pivot indices to permutation matrix may speed up computation but there are edge cases (repeated indices) in which results in mismatch from original
torch.lu_unpack()
- PyTorch lu unpack() supports only float and complex types
Related Issue
Closes #26225
Checklist
- [x] Did you add a function?
- [x] Did you add the tests?
- [x] Did you run your tests and are your tests passing?
- [x] Did pre-commit not fail on any check?
- [x] Did you follow the steps we provided?
Socials
Thank you for this PR, here is the CI results:
This pull request does not result in any additional test failures. Congratulations!
closing, as the test fails. feel free to re-open if you get it working