def test_rand(self): torch.manual_seed(123456) res1 = torch.rand(SIZE, SIZE) res2 = torch.Tensor() torch.manual_seed(123456) torch.rand(SIZE, SIZE, out=res2) self.assertEqual(res1, res2)