Restore cuda variable.bernoulli()#4787
Merged
ezyang merged 1 commit intopytorch:masterfrom Jan 24, 2018
Merged
Conversation
Collaborator
Contributor
|
I checked Declarations.cwrap for CPU-only functions, some are known (kthvalue, standard_gamma, some matrix ops), but maybe this is new one: torch.randperm(5, out = torch.LongTensor()) # works
torch.randperm(5, out = torch.autograd.Variable(torch.LongTensor())) # works
torch.randperm(5, out = torch.cuda.LongTensor()) # fails
# TypeError: Type torch.cuda.LongTensor doesn't implement stateless method randperm
torch.randperm(5, out = torch.autograd.Variable(torch.cuda.LongTensor())) # fails
# RuntimeError: randperm_out is not implemented for type torch.cuda.LongTensor |
Contributor
Author
|
@vadimkantorov there's currently no CUDA implementation of randperm |
facebook-github-bot
pushed a commit
that referenced
this pull request
Aug 7, 2020
…#4787) Summary: Pull Request resolved: pytorch/glow#4787 Resurrect ONNX as a backend through onnxifiGlow (was killed as part of D16215878). Then look for the `use_glow_aot` argument in the Onnxifi op. If it's there and true, then we override whatever `backend_id` is set and use the ONNX backend. Reviewed By: yinghai, rdzhabarov Differential Revision: D22762123 fbshipit-source-id: abb4c3458261f8b7eeae3016dda5359fa85672f0
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
…pytorch#4787) Summary: Pull Request resolved: pytorch/glow#4787 Resurrect ONNX as a backend through onnxifiGlow (was killed as part of D16215878). Then look for the `use_glow_aot` argument in the Onnxifi op. If it's there and true, then we override whatever `backend_id` is set and use the ONNX backend. Reviewed By: yinghai, rdzhabarov Differential Revision: D22762123 fbshipit-source-id: abb4c3458261f8b7eeae3016dda5359fa85672f0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4715
Variable bernoulli() was previously set to only CPU in Declarations.cwrap. This PR enables the cuda backend for that.
Test Plan
new unit test