-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take care with single integers on gpu
Summary: Pytorch seems to be becoming stricter about integer tensors of shape `(1,)` on GPU and not allowing them to be used as `int`s. For example the following no longer works on pytorch master, foo = torch.tensor([3, 5, 3], device="cuda:0") torch.arange(10) + foo[0] because this is the sum of tensors on different devices. Here fix tests which recently broke because of this. Reviewed By: nikhilaravi Differential Revision: D21929745 fbshipit-source-id: 25374f70468d1c895372766f1a9dd61df0833957
- Loading branch information
1 parent
d0e7426
commit 7f1e63a
Showing
3 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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