Skip to content

Commit

Permalink
Fix UntypedStorage pin error
Browse files Browse the repository at this point in the history
Summary:
Fixes:
```
TypeError: cannot pin 'torch.storage.UntypedStorage' only CPU memory can be pinned
```

Test Plan: Sandcastle

Differential Revision: D47093797

fbshipit-source-id: dca2fbaabfbdb05fc85f1b374e5de4b989c5c461
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jun 28, 2023
1 parent 4cbe067 commit ec017b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_storage_meta_errors(self, device, dtype):
with self.assertRaisesRegex(RuntimeError, r'only available on CUDA'):
s0._share_cuda_()

with self.assertRaisesRegex(NotImplementedError, r'Cannot copy out'):
with self.assertRaisesRegex(TypeError, r"cannot pin 'torch.storage.UntypedStorage' only CPU memory can be pinned"):
s0.pin_memory()

with self.assertRaisesRegex(RuntimeError, r'only available on CPU'):
Expand Down

0 comments on commit ec017b6

Please sign in to comment.