fix empty Tensor mmap

This commit is contained in:
Soumith Chintala 2017-07-13 02:54:17 -04:00
parent d6bc2642e7
commit 43eaa28b9f

View file

@ -393,6 +393,10 @@ class TestMultiprocessing(TestCase):
param = Parameter(torch.arange(1, 26).view(5, 5))
self._test_autograd_sharing(param)
def test_empty_shared(self):
t = torch.Tensor()
t.share_memory_()
def _test_is_shared(self):
t = torch.randn(5, 5)
self.assertFalse(t.is_shared())