espnet2.torch_utils.get_layer_from_string.get_layer
Less than 1 minute
espnet2.torch_utils.get_layer_from_string.get_layer
espnet2.torch_utils.get_layer_from_string.get_layer(l_name, library=<module 'torch.nn' from '/home/runner/work/espnet/espnet/tools/venv/lib/python3.10/site-packages/torch/nn/_init_.py'>)
Return layer object handler from library e.g. from torch.nn
E.g. if l_name==”elu”, returns torch.nn.ELU.
- Parameters:
- l_name (string) – Case insensitive name for layer in library (e.g. .’elu’).
- library (module) – Name of library/module where to search for object handler
- "torch.nn". (with l_name e.g.)
- Returns: handler for the requested layer e.g. (torch.nn.ELU)
- Return type: layer_handler (object)