a = tf.constant([[1., 2., 3.],
[4., 5., 6.]])
a = tf.reshape(x, [1, 2, 3, 1])
validPad = tf.nn.max_pool(x, [1, 2, 2, 1], [1, 2, 2, 1], padding='VALID')
samePad = tf.nn.max_pool(x, [1, 2, 2, 1], [1, 2, 2, 1], padding='SAME')
validPad.get_shape() == [1, 1, 1, 1]
samePad.get_shape() == [1, 1, 2, 1]
Output shapes are-
validPad : output shape is [1,1]
samePad: output shape is [1,2]