Skip to content
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

Resized compressed sparse tensor has wrong numel() result. #91830

Closed
pearu opened this issue Jan 6, 2023 · 0 comments
Closed

Resized compressed sparse tensor has wrong numel() result. #91830

pearu opened this issue Jan 6, 2023 · 0 comments
Assignees
Labels
module: correctness (silent) issue that returns an incorrect result silently module: sparse Related to torch.sparse triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@pearu
Copy link
Collaborator

pearu commented Jan 6, 2023

There is a bug in resize_ of sparse compressed tensor:

>>> torch.empty((0, 0), layout=torch.sparse_csr).resize_((2, 2)).numel()
0

The expected value is 4:

>>> torch.empty((2, 2), layout=torch.sparse_csr).numel()
4

Originally posted by @pearu in #90177 (comment)

cc @alexsamardzic @nikitaved @cpuhrsch @amjames @bhosmer

@pearu pearu added module: sparse Related to torch.sparse module: correctness (silent) issue that returns an incorrect result silently labels Jan 6, 2023
@pearu pearu added this to To do in Sparse tensors via automation Jan 6, 2023
@pearu pearu self-assigned this Jan 6, 2023
@pearu pearu linked a pull request Jan 6, 2023 that will close this issue
@albanD albanD added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jan 10, 2023
Sparse tensors automation moved this from To do to Done Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: correctness (silent) issue that returns an incorrect result silently module: sparse Related to torch.sparse triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Development

Successfully merging a pull request may close this issue.

2 participants