(cfg, *args, **kwargs)
return layer
Build convolution layer

    Args:
        cfg (None or dict): cfg should contain:
            type (str): identify conv layer type.
            layer args: args needed to instantiate a conv layer.

    Returns:
        layer (nn.Module): created conv layer
Build convolution layer
Build convolution layer
def build_conv_layer(cfg, *args, **kwargs):
    """ Build convolution layer

    Args:
        cfg (None or dict): cfg should contain:
            type (str): identify conv layer type.
            layer args: args needed to instantiate a conv layer.

    Returns:
        layer (nn.Module): created conv layer
    """
    if cfg is None:
        cfg_ = dict(type='Conv')
    else:
        assert isinstance(cfg, dict) and 'type' in cfg
        cfg_ = cfg.copy()

    layer_type = cfg_.pop('type')
    if layer_type not in conv_cfg:
        raise KeyError('Unrecognized norm type {}'.format(layer_type))
    else:
        conv_layer = conv_cfg[layer_type]

    layer = conv_layer(*args, **kwargs, **cfg_)

    return layer
def build_conv_layer ( cfg , * args , * * kwargs ) : if cfg is None : cfg_ = dict ( type = 'Conv' ) else : assert isinstance ( cfg , dict ) and 'type' in cfg cfg_ = cfg . copy ( ) layer_type = cfg_ . pop ( 'type' ) if layer_type not in conv_cfg : raise KeyError ( 'Unrecognized norm type {}' . format ( layer_type ) ) else : conv_layer = conv_cfg [ layer_type ] layer = conv_layer ( * args , * * kwargs , * * cfg_ ) return layer