'Convolution.'

def _conv(self, x, kernel_size, filters, strides, is_atrous=False):

    padding = 'SAME'
    if ((not is_atrous) and (strides > 1)):
        pad = (kernel_size - 1)
        pad_beg = (pad // 2)
        pad_end = (pad - pad_beg)
        if (self._data_format == 'channels_first'):
            x = tf.pad(x, [[0, 0], [0, 0], [pad_beg, pad_end], [pad_beg, pad_end]])
        else:
            x = tf.pad(x, [[0, 0], [pad_beg, pad_end], [pad_beg, pad_end], [0, 0]])
        padding = 'VALID'
    return tf.layers.conv2d(inputs=x, kernel_size=kernel_size, filters=filters, strides=strides, padding=padding, use_bias=False, data_format=self._data_format)
