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 @gpu_test
28 @p100_exempt
29 def test_gpu_computation(self):
30 cuda = torch.device('cuda')
31 a = torch.tensor([1., 2.], device=cuda)
32
33 result = a.sum()
34
35 self.assertEqual(torch.tensor([3.], device=cuda), result)
36
37 @gpu_test
38 @p100_exempt

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected