Coverage for /home/ubuntu/flatiron/python/flatiron/torch/metric.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-08 21:55 +0000

1from flatiron.core.types import Getter # noqa F401 

2 

3from torch.nn import Module # noqa: F401 

4import torchmetrics # noqa F401 

5 

6import flatiron.torch.tools as fi_torchtools 

7# ------------------------------------------------------------------------------ 

8 

9 

10def get(config): 

11 # type: (Getter) -> Module 

12 ''' 

13 Get function from this module. 

14 

15 Args: 

16 config (dict): Loss config. 

17 

18 Returns: 

19 function: Module function. 

20 ''' 

21 return fi_torchtools.get(config, __name__, 'torchmetrics')