Update misleading torch.sparse_coo_tensor error check#161900
Update misleading torch.sparse_coo_tensor error check#161900parsshar-RH wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161900
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 5fdae41 with merge base dd2519a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@salilsdesai @kimishpatel @digantdesai @jianyuh Please review the PR |
|
@pytorchbot label "module: sparse" |
pearu
left a comment
There was a problem hiding this comment.
LGTM! Thanks, @parsshar-RH!
Btw, apparently we don't have tests for exceptions that may be raised from sparse COO tensors construction. For sparse compressed tensors we have
pytorch/test/test_sparse_csr.py
Line 876 in b477fb1
However, I don't expect that the missing tests for sparse COO tensors covering all invalid input cases should be implemented in this PR, but it would be a nice follow-up that would reveal if there exists more exception messages that could be improved similar to this PR.
|
Thanks for the valuable feedback and reviews. Thanks |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes pytorch#160622 ### Summary Updated the misleading torch.sparse_coo_tensor error check to provide clear context. earlier: `RuntimeError: number of dimensions must be sparse_dim (3) + dense_dim (0), but got 1` Updated: `RuntimeError: 'len(size) == sparse_dim + dense_dim' is not satisfied: len(size) = 1, sparse_dim = 3, dense_dim = 0` **Impacts:** - Comprehensive error message that will improve developer experience. - module: sparse Pull Request resolved: pytorch#161900 Approved by: https://github.com/nikitaved, https://github.com/pearu
Fixes pytorch#160622 ### Summary Updated the misleading torch.sparse_coo_tensor error check to provide clear context. earlier: `RuntimeError: number of dimensions must be sparse_dim (3) + dense_dim (0), but got 1` Updated: `RuntimeError: 'len(size) == sparse_dim + dense_dim' is not satisfied: len(size) = 1, sparse_dim = 3, dense_dim = 0` **Impacts:** - Comprehensive error message that will improve developer experience. - module: sparse Pull Request resolved: pytorch#161900 Approved by: https://github.com/nikitaved, https://github.com/pearu
Fixes pytorch#160622 ### Summary Updated the misleading torch.sparse_coo_tensor error check to provide clear context. earlier: `RuntimeError: number of dimensions must be sparse_dim (3) + dense_dim (0), but got 1` Updated: `RuntimeError: 'len(size) == sparse_dim + dense_dim' is not satisfied: len(size) = 1, sparse_dim = 3, dense_dim = 0` **Impacts:** - Comprehensive error message that will improve developer experience. - module: sparse Pull Request resolved: pytorch#161900 Approved by: https://github.com/nikitaved, https://github.com/pearu
Fixes pytorch#160622 ### Summary Updated the misleading torch.sparse_coo_tensor error check to provide clear context. earlier: `RuntimeError: number of dimensions must be sparse_dim (3) + dense_dim (0), but got 1` Updated: `RuntimeError: 'len(size) == sparse_dim + dense_dim' is not satisfied: len(size) = 1, sparse_dim = 3, dense_dim = 0` **Impacts:** - Comprehensive error message that will improve developer experience. - module: sparse Pull Request resolved: pytorch#161900 Approved by: https://github.com/nikitaved, https://github.com/pearu
Fixes #160622
Summary
Updated the misleading torch.sparse_coo_tensor error check to provide clear context.
earlier:
RuntimeError: number of dimensions must be sparse_dim (3) + dense_dim (0), but got 1Updated:
RuntimeError: 'len(size) == sparse_dim + dense_dim' is not satisfied: len(size) = 1, sparse_dim = 3, dense_dim = 0Impacts:
cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer @jcaip