I read What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow? but this is not true to my experiment.
import tensorflow as tf
inputs = tf.random_normal([1, 64, 64, 3])
print(inputs.shape)
conv = tf.keras.layers.Conv2D(6, 4, strides=2, padding='same')
outputs = conv(inputs)
print(outputs.shape)
produces
(1, 64, 64, 3)
(1, 32, 32, 6)
. However following the above link produces (1, 31, 31, 6) because there is no extra values outside filter ranges without any padding.
How does tf.keras.layers.Conv2D with padding='same' and strides > 1 behave?
I want to know the exact answer and its evidence.