Skip to content

Conversation

@izdeby
Copy link
Contributor

@izdeby izdeby commented May 10, 2019

Fixing reported issue.

@pytorchbot pytorchbot added module: cuda Related to torch.cuda, and CUDA support in general module: operators labels May 10, 2019
@izdeby izdeby requested review from gchanan and zou3519 May 10, 2019 17:22
expected = torch.zeros(100, dtype=torch.float, device=device)
expected.data[0] = 1
expected.data[99] = 1
self.assertEqual(expected, actual)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

@izdeby izdeby changed the title Fixed histc return type for CUDA [WIP]Fixed histc return type for CUDA May 10, 2019
@izdeby izdeby requested a review from VitalyFedyunin May 10, 2019 18:53
@izdeby izdeby changed the title [WIP]Fixed histc return type for CUDA Fixed histc return type for CUDA May 10, 2019
@izdeby izdeby requested a review from zou3519 May 10, 2019 18:56
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

zdevito pushed a commit to zdevito/ATen that referenced this pull request May 20, 2019
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
@facebook-github-bot
Copy link
Contributor

@izdeby merged this pull request in 71260b9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: cuda Related to torch.cuda, and CUDA support in general

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants