input = tf.placeholder(tf.float32, [None, 28, 28, 3])
padded_input = tf.pad(input, [[0, 0], [2, 2], [1, 1], [0, 0]], 'CONSTANT')
filter = tf.placeholder(tf.float32, [5, 5, 3, 16])
Custom padding for convolutions in TensorFlow