Skip to content

Conversation

@cpuhrsch
Copy link
Contributor

Description

Small changes needed to deal with nnz 0 inputs.

Issue

#82107

Testing

Added additional test coverage to reproduce bug reported in issue. Tested resulting values by conversion to_dense.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 25, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

As of commit 230c1ae (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@cpuhrsch cpuhrsch requested review from ezyang and pearu July 25, 2022 19:37
@cpuhrsch cpuhrsch marked this pull request as ready for review July 25, 2022 19:37
@cpuhrsch cpuhrsch requested a review from bhosmer July 25, 2022 19:37
Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

auto nnz = values.size(0);
auto sizes = input.sizes();
auto nvalues = values.numel() / nnz;
auto nvalues = get_nvalues(sizes, sparse_dim);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the CPU kernel does.

@cpuhrsch
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

Hey @cpuhrsch.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@cpuhrsch cpuhrsch added the topic: not user facing topic category label Jul 26, 2022
facebook-github-bot pushed a commit that referenced this pull request Jul 27, 2022
…meters (#82149) (#82149)

Summary:
### Description
Small changes needed to deal with nnz 0 inputs.

### Issue
#82107

### Testing
Added additional test coverage to reproduce bug reported in issue. Tested resulting values by conversion `to_dense`.

Pull Request resolved: #82149
Approved by: https://github.com/jbschlosser, https://github.com/ezyang

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/6ab1fe19eec0aa610bca6de881d373905da2fb37

Reviewed By: osalpekar

Differential Revision: D38142983

Pulled By: cpuhrsch

fbshipit-source-id: 3bab68a33d38100677accedbee875c967da80093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants