test_cuaev.py 757 Bytes
Newer Older
1
2
3
4
5
6
7
8
import torchani
import unittest
import torch

skipIfNoGPU = unittest.skipIf(not torch.cuda.is_available(),
                              'There is no device to run this test')


9
@unittest.skipIf(not torchani.has_cuaev, "only valid when cuaev is installed")
10
11
class TestCUAEV(unittest.TestCase):

12
13
14
15
16
17
    def testJIT(self):
        def f(coordinates, species, Rcr: float, Rca: float, EtaR, ShfR, EtaA, Zeta, ShfA, ShfZ, num_species: int):
            return torch.ops.cuaev.cuComputeAEV(coordinates, species, Rcr, Rca, EtaR, ShfR, EtaA, Zeta, ShfA, ShfZ, num_species)
        s = torch.jit.script(f)
        self.assertIn("cuaev::cuComputeAEV", str(s.graph))

18
19
    @skipIfNoGPU
    def testHello(self):
20
        pass
21
22
23
24


if __name__ == '__main__':
    unittest.main()