

def conv2d(x, kernel, strides=(1, 1), border_mode='valid', dim_ordering='th', image_shape=None, filter_shape=None):
    '2D convolution.\n\n    # Arguments\n        kernel: kernel tensor.\n        strides: strides tuple.\n        border_mode: string, "same" or "valid".\n        dim_ordering: "tf" or "th". Whether to use Theano or TensorFlow dimension ordering\n        in inputs/kernels/ouputs.\n    '
    if (border_mode == 'same'):
        padding = 'SAME'
    elif (border_mode == 'valid'):
        padding = 'VALID'
    else:
        raise Exception(('Invalid border mode: ' + str(border_mode)))
    strides = (((1,) + strides) + (1,))
    if (_FLOATX == 'float64'):
        x = tf.cast(x, 'float32')
        kernel = tf.cast(kernel, 'float32')
    if (dim_ordering == 'th'):
        x = tf.transpose(x, (0, 2, 3, 1))
        kernel = tf.transpose(border_mode, (2, 3, 1, 0))
        x = tf.nn.conv2d(x, kernel, strides, padding=padding)
        x = tf.transpose(x, (0, 3, 1, 2))
    elif (dim_ordering == 'tf'):
        x = tf.nn.conv2d(x, kernel, strides, padding=padding)
    else:
        raise Exception(('Unknown dim_ordering: ' + str(dim_ordering)))
    if (_FLOATX == 'float64'):
        x = tf.cast(x, 'float64')
    return x

dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py conv2d/VarMisuse@168/324 `kernel`->`border_mode`