(inputs,
         filters,
         kernel,
         strides=None,
         dilation=None,
         num_groups=1,
         conv_param=None,
         name=None)
return fluid.layers.conv2d(
        inputs,
        filters,
        kernel,
        stride=strides,
        padding=0,
        dilation=dilation,
        groups=num_groups,
        param_attr=param_attr if conv_param is None else conv_param,
        use_cudnn=False if num_groups == inputs.shape[1] == filters else True,
        name=name)
normal conv layer
normal conv layer
normal conv layer
def conv(inputs,
         filters,
         kernel,
         strides=None,
         dilation=None,
         num_groups=1,
         conv_param=None,
         name=None):
    """
        normal conv layer
    """
    if strides is None:
        strides = (1, 1)
    if dilation is None:
        dilation = (1, 1)
    if isinstance(kernel, (tuple, list)):
        n = operator.mul(*kernel) * inputs.shape[1]
    else:
        n = kernel * kernel * inputs.shape[1]

    # pad input
    padding = (0, 0, 0, 0) \
        + calc_padding(inputs.shape[2], strides[0], dilation[0], kernel[0]) \
        + calc_padding(inputs.shape[3], strides[1], dilation[1], kernel[1])
    if sum(padding) > 0:
        inputs = fluid.layers.pad(inputs, padding, 0)

    param_attr = fluid.param_attr.ParamAttr(
        initializer=fluid.initializer.TruncatedNormal(
            0.0, scale=np.sqrt(2.0 / n)),
        regularizer=fluid.regularizer.L2Decay(FLAGS.weight_decay))

    return fluid.layers.conv2d(
        inputs,
        filters,
        kernel,
        stride=strides,
        padding=0,
        dilation=dilation,
        groups=num_groups,
        param_attr=param_attr if conv_param is None else conv_param,
        use_cudnn=False if num_groups == inputs.shape[1] == filters else True,
        name=name)
def conv ( inputs , filters , kernel , strides = None , dilation = None , num_groups = 1 , conv_param = None , name = None ) : if strides is None : strides = ( 1 , 1 ) if dilation is None : dilation = ( 1 , 1 ) if isinstance ( kernel , ( tuple , list ) ) : n = operator . mul ( * kernel ) * inputs . shape [ 1 ] else : n = kernel * kernel * inputs . shape [ 1 ] # pad input padding = ( 0 , 0 , 0 , 0 ) + calc_padding ( inputs . shape [ 2 ] , strides [ 0 ] , dilation [ 0 ] , kernel [ 0 ] ) + calc_padding ( inputs . shape [ 3 ] , strides [ 1 ] , dilation [ 1 ] , kernel [ 1 ] ) if sum ( padding ) > 0 : inputs = fluid . layers . pad ( inputs , padding , 0 ) param_attr = fluid . param_attr . ParamAttr ( initializer = fluid . initializer . TruncatedNormal ( 0.0 , scale = np . sqrt ( 2.0 / n ) ) , regularizer = fluid . regularizer . L2Decay ( FLAGS . weight_decay ) ) return fluid . layers . conv2d ( inputs , filters , kernel , stride = strides , padding = 0 , dilation = dilation , groups = num_groups , param_attr = param_attr if conv_param is None else conv_param , use_cudnn = False if num_groups == inputs . shape [ 1 ] == filters else True , name = name )