-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fixed histc return type for CUDA #20369
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
| expected = torch.zeros(100, dtype=torch.float, device=device) | ||
| expected.data[0] = 1 | ||
| expected.data[99] = 1 | ||
| self.assertEqual(expected, actual) |
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.
I'm confused: the original code tested CUDA tensors by sending them through this path. Does self.assertEqual ignore dtype when comparing tensors?
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.
apparently it does. i just tried this:
self.assertEqual(torch.tensor([1], dtype=torch.int), torch.tensor([1], dtype=torch.double)) and it didn't fail. I will create an issue for this cause its really concerning.
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.
Thanks for checking that, that is concerning.
Could you add another test to check if the dtype of the output is correct, then?
facebook-github-bot
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.
@izdeby has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
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.
@izdeby has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
zou3519
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, thank you
Summary: Fixing reported [issue](pytorch/pytorch#20208). Pull Request resolved: pytorch/pytorch#20369 Reviewed By: zou3519 Differential Revision: D15300959 Pulled By: izdeby fbshipit-source-id: 219692f99a66ea433112dfc226132eb6867122cf
Fixing reported issue.