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

implement bool_tensor.bernoulli_ #25076

Closed
wants to merge 1 commit into from
Closed

Conversation

ssnl
Copy link
Collaborator

@ssnl ssnl commented Aug 23, 2019

Fixes #25072

@pytorchbot pytorchbot added module: cpu CPU specific problem (e.g., perf, algorithm) module: cuda Related to torch.cuda, and CUDA support in general module: operators labels Aug 23, 2019
@@ -132,7 +132,7 @@ Tensor& bernoulli_out(Tensor& result, const Tensor& self, Generator* gen) {
}

Tensor& bernoulli_tensor_cpu_(Tensor& self, const Tensor& p_, Generator* gen) {
AT_DISPATCH_ALL_TYPES(self.scalar_type(), "bernoulli_tensor_cpu_self_", [&] {
AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::Bool, self.scalar_type(), "bernoulli_tensor_cpu_self_", [&] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a difference between CPU and CUDA bernoulli_ implementations w.r.t. supporting half precision?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think a lot ops are not supported for CPU half due to inefficiency.

@ssnl
Copy link
Collaborator Author

ssnl commented Aug 27, 2019

@izdeby could you review?

@ssnl ssnl requested a review from izdeby August 27, 2019 14:41
@ssnl
Copy link
Collaborator Author

ssnl commented Aug 27, 2019

@pytorchbot merge this please

@pytorchbot pytorchbot added the merge-this-please Was marked for merge with @pytorchbot merge this please label Aug 27, 2019
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.

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in 6100de9.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 28, 2019
Summary:
Fixes pytorch/pytorch#25072
Pull Request resolved: pytorch/pytorch#25076

Differential Revision: D17073453

Pulled By: ezyang

fbshipit-source-id: 42410da8c9911c1d7b3543bde740c7e66ae0cc1c
@ssnl ssnl deleted the bernoulli_bool branch August 28, 2019 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-this-please Was marked for merge with @pytorchbot merge this please Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: cuda Related to torch.cuda, and CUDA support in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] implement bernoulli_ for Bool tensor
6 participants