Skip to content

Commit

Permalink
Fix UntypedStorage pin error (pytorch#104355)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#104355

Fixes:
```
TypeError: cannot pin 'torch.storage.UntypedStorage' only CPU memory can be pinned
```

Test Plan: Sandcastle

Differential Revision: D47093797

fbshipit-source-id: 54ace8fad4aecf5055f1448bba309ded7517791a
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jun 28, 2023
1 parent 998c077 commit deb3591
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 deb3591

Please sign in to comment.