-
Notifications
You must be signed in to change notification settings - Fork 23
Implement dpnp.linalg.lu_factor 2D inputs
#2557
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
Conversation
|
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
|
Array API standard conformance tests for dpnp=0.19.0dev3=py313h509198e_30 ran successfully. |
ndgrigorian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR suggests adding `dpnp.linalg.lu_factor()` for 2D arrays similar to `scipy.linalg.lu_factor` Support for ND inputs will be added in the next phase. In addition, this PR includes: 1. An updated implementation of `getrf` to support non-square matrices. 2. Refactoring of `_lu_factor()` by splitting the logic into separate functions to improve readability and maintainability. 6eb6f6f
This PR suggests extending `dpnp.linalg.lu_factor()` #2557 for batch arrays In addition, this PR includes: An updated implementation of getrf_batch to support non-square matrices
| Whether to overwrite data in `a` (may increase performance) | ||
| Default: ``False``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether to overwrite data in `a` (may increase performance).
Default: ``False``.| check_finite : {None, bool}, optional | ||
| Whether to check that the input matrix contains only finite numbers. | ||
| Disabling may give a performance gain, but may result in problems | ||
| (crashes, non-termination) if the inputs do contain infinities or NaNs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default: ``True``.
| Returns | ||
| ------- | ||
| lu :(M, N) dpnp.ndarray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sems space is missing: lu : (M, N)
| lu :(M, N) dpnp.ndarray | ||
| Matrix containing U in its upper triangle, and L in its lower triangle. | ||
| The unit diagonal elements of L are not stored. | ||
| piv (K, ): dpnp.ndarray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
piv : (K, ) dpnp.ndarray
| return dpnp_lstsq(a, b, rcond=rcond) | ||
|
|
||
|
|
||
| def lu_factor(a, overwrite_a=False, check_finite=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for the function is not rendering
| if any(dev_info_h): | ||
| diag_nums = ", ".join(str(v) for v in dev_info_h if v > 0) | ||
| warn( | ||
| f"Diagonal number {diag_nums} are exactly zero. Singular matrix.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Diagonal number {diag_nums} is exactly zero. Singular matrix."
| a_h.get_array(), | ||
| ipiv_h.get_array(), | ||
| dev_info_h, | ||
| depends=[copy_ev] if copy_ev is not None else [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must depend on _manager.submitted_events if copy is None
This PR suggests adding `dpnp.linalg.lu_factor()` for 2D arrays similar to `scipy.linalg.lu_factor` Support for ND inputs will be added in the next phase. In addition, this PR includes: 1. An updated implementation of `getrf` to support non-square matrices. 2. Refactoring of `_lu_factor()` by splitting the logic into separate functions to improve readability and maintainability.
This PR suggests extending `dpnp.linalg.lu_factor()` #2557 for batch arrays In addition, this PR includes: An updated implementation of getrf_batch to support non-square matrices
This PR suggests adding
dpnp.linalg.lu_factor()for 2D arrays similar toscipy.linalg.lu_factorSupport for ND inputs will be added in the next phase.
In addition, this PR includes:
getrfto support non-square matrices._lu_factor()by splitting the logic into separate functions to improve readability and maintainability.