nnrl/optim/utils.py
def build_optimizer(module: nn.Module, config: dict, wrap: bool = False) -> Optimizer:
    """Build optimizer with the desired config and tied to a module.

    Args:
        module: the module to tie the optimizer to (or its parameters)
        config: mapping containing the 'type' of the optimizer and additional
            kwargs.
        wrap: whether to wrap the class with :func:`wrap_optim_cls`.
    """
    cls = get_optimizer_class(config["type"], wrap=wrap)
    return link_optimizer(cls, module, {k: v for k, v in config.items() if k != "type"})
Build optimizer with the desired config and tied to a module.

    Args:
        module: the module to tie the optimizer to (or its parameters)
        config: mapping containing the 'type' of the optimizer and additional
            kwargs.
        wrap: whether to wrap the class with :func:`wrap_optim_cls`.
    
Build optimizer with the desired config and tied to a module.
Build optimizer with the desired config and tied to a module .
def build_optimizer(module: nn.Module, config: dict, wrap: bool = False) -> Optimizer:
    cls = get_optimizer_class(config["type"], wrap=wrap)
    return link_optimizer(cls, module, {k: v for k, v in config.items() if k != "type"})
def build_optimizer ( module : nn . Module , config : dict , wrap : bool = False ) -> Optimizer : cls = get_optimizer_class ( config [ "type" ] , wrap = wrap ) return link_optimizer ( cls , module , { k : v for k , v in config . items ( ) if k != "type" } )
Build optimizer with the desired config and tied to a module.
Build optimizer with the desired config and tied to a module .
"""Build optimizer with the desired config and tied to a module.

    Args:
        module: the module to tie the optimizer to (or its parameters)
        config: mapping containing the 'type' of the optimizer and additional
            kwargs.
        wrap: whether to wrap the class with :func:`wrap_optim_cls`.
    """
module
nn.Module
the module to tie the optimizer to (or its parameters)
the module to tie the optimizer to ( or its parameters )
config
dict
mapping containing the 'type' of the optimizer and additional
kwargs.
mapping containing the ' type ' of the optimizer and additional kwargs .
wrap
bool
whether to wrap the class with :func:`wrap_optim_cls`.
whether to wrap the class with : func : ` wrap_optim_cls ` .