TrainingExtensions/torch/src/python/aimet_torch/model_preparer.py
def _create_module_for_functional_node(node: torch.fx.node, functional_name: str) -> torch.nn.Module:
    """
    For given node and functional name, create torch.nn.Module with same parameters as functional node parameters
    :param node: torch.fx Node
    :param functional_name: Functional name for given node
    :return: New module
    """
    kwargs = node.kwargs

    # Instantiate new module from lookup
    module = functional_to_module_map[functional_name]()

    # Set the parameters for module from node.kwargs
    for key, value in kwargs.items():
        setattr(module, key, value)

    return module

    For given node and functional name, create torch.nn.Module with same parameters as functional node parameters
    :param node: torch.fx Node
    :param functional_name: Functional name for given node
    :return: New module
    
For given node and functional name, create torch.nn.Module with same parameters as functional node parameters
For given node and functional name create torch . nn . Module with same parameters as functional node parameters
def _create_module_for_functional_node(node: torch.fx.node, functional_name: str) -> torch.nn.Module:
    kwargs = node.kwargs
    module = functional_to_module_map[functional_name]()
    for key, value in kwargs.items():
        setattr(module, key, value)
    return module
def _create_module_for_functional_node ( node : torch . fx . node , functional_name : str ) -> torch . nn . Module : kwargs = node . kwargs module = functional_to_module_map [ functional_name ] ( ) for key , value in kwargs . items ( ) : setattr ( module , key , value ) return module
For given node and functional name, create torch.nn.Module with same parameters as functional node parameters
For given node and functional name create torch . nn . Module with same parameters as functional node parameters
"""
    For given node and functional name, create torch.nn.Module with same parameters as functional node parameters
    :param node: torch.fx Node
    :param functional_name: Functional name for given node
    :return: New module
    """ # Instantiate new module from lookup # Set the parameters for module from node.kwargs
None
node
torch.fx.node
None
functional_name
str
Functional name for given node
Functional name for given node