Coverage for /home/ubuntu/flatiron/python/flatiron/torch/loss.py: 100%
5 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-08 21:55 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-08 21:55 +0000
1from flatiron.core.types import Getter # noqa F401
3from torch.nn import Module # noqa: F401
5import flatiron.torch.tools as fi_torchtools
6# ------------------------------------------------------------------------------
9def get(config):
10 # type: (Getter) -> Module
11 '''
12 Get function from this module.
14 Args:
15 config (dict): Loss config.
17 Returns:
18 function: Module function.
19 '''
20 return fi_torchtools.get(config, __name__, 'torch.nn.modules.loss')