(self)
| 27 | def test_gpu_computation(self): |
| 28 | cuda = torch.device('cuda') |
| 29 | a = torch.tensor([1., 2.], device=cuda) |
| 30 | |
| 31 | result = a.sum() |
| 32 | |
| 33 | self.assertEqual(torch.tensor([3.], device=cuda), result) |
| 34 | |
| 35 | @gpu_test |
| 36 | def test_cuda_nn(self): |
| 37 | # These throw if cuda is misconfigured |
| 38 | tnn.GRUCell(10,10).cuda() |
nothing calls this directly
no outgoing calls
no test coverage detected