Fix GPU device placement when calling tensor.cuda()#624
Merged
neerajprad merged 5 commits intodevfrom Dec 15, 2017
Merged
Conversation
fritzo
commented
Dec 13, 2017
| sample_std = torch.std(torch.stack(samples), 0) | ||
| assert_equal(sample_mean.data, torch.Tensor([0.0]), prec=5e-2) | ||
| assert_equal(sample_std.data, torch.Tensor([1.0]), prec=5e-2) | ||
| assert_equal(sample_mean.data, torch.Tensor([0.0]), prec=0.1) |
Member
Author
There was a problem hiding this comment.
I had to loosen this tolerance due to flakiness. I assume the CUDA rng state is slightly different.
055f577 to
934b356
Compare
neerajprad
reviewed
Dec 14, 2017
| :rtype: torch.autograd.Variable. | ||
| """ | ||
| return Variable(self.v.data) | ||
| return Variable(self.v.data.unsqueeze(0)) |
Member
|
Not sure what's wrong, but all the builds are returning: |
Member
|
Can we remove #627 from this PR, to get this merged earlier? |
Member
Author
This PR relies on newer functionality of |
82c0f85 to
f34e01f
Compare
Member
If there is a lot of effort involved, we could just wait for the smaller wheel to be available. |
Member
Author
|
@neerajprad Looks like this is ready to merge |
neerajprad
approved these changes
Dec 15, 2017
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 #623
Suggested by @apaszke
This also fixes the shape of
distributions.Delta.enumerate_support(), which was returning an element rather than a singleton tensor containing that element (to see the difference, considerfor x in dist.enumerate_support(): ...).Testing
I tested that this runs on a single GPU but I have not tested on a multi-GPU system.