def __init__(self, in_channels, out_channels, kernel_size, stride, pad_mode, padding, dilation, group, has_bias, weight_init, bias_init, transposed=False):
    super(_Conv, self).__init__()
    self.in_channels = check_int_positive(in_channels)
    self.out_channels = check_int_positive(out_channels)
    self.kernel_size = kernel_size
    self.stride = stride
    self.pad_mode = pad_mode
    self.weight_init = weight_init
    self.bias_init = bias_init
    if isinstance(padding, int):
        Validator.check_integer('padding', padding, 0, Rel.GE, self.cls_name)
        self.padding = padding
    elif isinstance(padding, tuple):
        for pad in padding:
            Validator.check_integer('padding item', pad, 0, Rel.GE, self.cls_name)
        self.padding = padding
    else:
        raise TypeError('padding type must be int/tuple(int) cannot be {}!'.format(type(padding)))
    self.dilation = dilation
    self.group = check_int_positive(group)
    self.has_bias = has_bias
    if ((not isinstance(kernel_size[0], int)) or (not isinstance(kernel_size[1], int)) or isinstance(kernel_size[0], bool) or isinstance(kernel_size[1], bool) or (kernel_size[0] < 1) or (kernel_size[1] < 1)):
        raise ValueError((("Attr 'kernel_size' of 'Conv2D' Op passed " + str(self.kernel_size)) + ', should be a int or tuple and equal to or greater than 1.'))
    if ((not isinstance(stride[0], int)) or (not isinstance(stride[1], int)) or isinstance(stride[0], bool) or isinstance(stride[1], bool) or (stride[0] < 1) or (stride[1] < 1)):
        raise ValueError((("Attr 'stride' of 'Conv2D' Op passed " + str(self.stride)) + ', should be a int or tuple and equal to or greater than 1.'))
    if ((not isinstance(dilation[0], int)) or (not isinstance(dilation[1], int)) or isinstance(dilation[0], bool) or isinstance(dilation[1], bool) or (dilation[0] < 1) or (dilation[1] < 1)):
        raise ValueError((("Attr 'dilation' of 'Conv2D' Op passed " + str(self.dilation)) + ', should be a int or tuple and equal to or greater than 1.'))
    if ((in_channels % group) != 0):
        raise ValueError("Attr 'in_channels' of 'Conv2D' Op must be divisible by attr 'group' of 'Conv2D' Op.")
    if ((out_channels % group) != 0):
        raise ValueError("Attr 'out_channels' of 'Conv2D' Op must be divisible by attr 'group' of 'Conv2D' Op.")
    if transposed:
        shape = [in_channels, (out_channels // group), *kernel_size]
    else:
        shape = [out_channels, (in_channels // group), *kernel_size]
    self.weight = Parameter(initializer(self.weight_init, shape), name='weight')
    if check_bool(has_bias):
        self.bias = Parameter(initializer(self.bias_init, [out_channels]), name='bias')
    else:
        if (self.bias_init != 'zeros'):
            logger.warning("Value of 'has_bias' is False, value of 'bias_init' will be ignored.")
        self.bias = None
def __init__(self, in_channels, out_channels, kernel_size, stride, pad_mode, padding, dilation, group, has_bias, weight_init, bias_init, transposed=False):
    super(_Conv, self).__init__()
    self.in_channels = check_int_positive(in_channels)
    self.out_channels = check_int_positive(out_channels)
    self.kernel_size = kernel_size
    self.stride = stride
    self.pad_mode = pad_mode
    self.weight_init = weight_init
    self.bias_init = bias_init
    if isinstance(padding, int):
        Validator.check_integer('padding', padding, 0, Rel.GE, self.cls_name)
        self.padding = padding
    elif isinstance(padding, tuple):
        for pad in padding:
            Validator.check_integer('padding item', pad, 0, Rel.GE, self.cls_name)
        self.padding = padding
    else:
        raise TypeError('padding type must be int/tuple(int) cannot be {}!'.format(type(padding)))
    self.dilation = dilation
    self.group = check_int_positive(group)
    self.has_bias = has_bias
    if ((not isinstance(kernel_size[0], int)) or (not isinstance(kernel_size[1], int)) or isinstance(kernel_size[0], bool) or isinstance(kernel_size[1], bool) or (kernel_size[0] < 1) or (kernel_size[1] < 1)):
        raise ValueError((("Attr 'kernel_size' of 'Conv2D' Op passed " + str(self.kernel_size)) + ', should be a int or tuple and equal to or greater than 1.'))
    if ((not isinstance(stride[0], int)) or (not isinstance(stride[1], int)) or isinstance(stride[0], bool) or isinstance(stride[1], bool) or (stride[0] < 1) or (stride[1] < 1)):
        raise ValueError((("Attr 'stride' of 'Conv2D' Op passed " + str(self.stride)) + ', should be a int or tuple and equal to or greater than 1.'))
    if ((not isinstance(dilation[0], int)) or (not isinstance(dilation[1], int)) or isinstance(dilation[0], bool) or isinstance(dilation[1], bool) or (dilation[0] < 1) or (dilation[1] < 1)):
        raise ValueError((("Attr 'dilation' of 'Conv2D' Op passed " + str(self.dilation)) + ', should be a int or tuple and equal to or greater than 1.'))
    if ((in_channels % group) != 0):
        raise ValueError("Attr 'in_channels' of 'Conv2D' Op must be divisible by attr 'group' of 'Conv2D' Op.")
    if ((out_channels % group) != 0):
        raise ValueError("Attr 'out_channels' of 'Conv2D' Op must be divisible by attr 'group' of 'Conv2D' Op.")
    if transposed:
        shape = [in_channels, (out_channels // group), *kernel_size]
    else:
        shape = [out_channels, (in_channels // group), *kernel_size]
    self.weight = Parameter(initializer(self.weight_init, shape), name='weight')
    if check_bool(has_bias):
        self.bias = Parameter(initializer(self.bias_init, [out_channels]), name='bias')
    else:
        if (self.bias_init != 'zeros'):
            logger.warning("Value of 'has_bias' is False, value of 'bias_init' will be ignored.")
        self.bias = None