import tensorflow as tf

        
        return tf.layers.conv2d(input, channels, kernel_size=size, strides=[stride, stride],
                                padding=padding, kernel_initializer=init, name='conv' + id,
                                use_bias=use_bias, dilation_rate=(dilation, dilation))

    def z_conv(self, id, input, channels, size, stride=1, padding="SAME", use_bias=False, dilation=1):
        # zero mean conv
        if type(size) == int: size = [size, size]
        in_ch = input.get_shape().as_list()[-1]
        # init = tf.contrib.layers.variance_scaling_initializer(dtype=tf.float32)
        init = tf.truncated_normal_initializer(mean=0.0, stddev=0.02)
        filters = tf.get_variable('zero_conv_weights' + id, initializer=init, shape=[size[0], size[1], in_ch, channels])
        filters = filters - tf.reduce_mean(filters, axis=[0, 1, 2], keepdims=True)

        if padding == "PARTIAL":
            with tf.variable_scope('mask'):
                _, h, w, _ = input.get_shape().as_list()

                slide_window = size[0] * size[1]
                mask = tf.ones(shape=[1, h, w, 1])
