MCPcopy Create free account
hub / github.com/Kaggle/docker-python / test_gpu_computation

Method test_gpu_computation

tests/test_pytorch.py:29–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected