Stride
is the amount you want to skip in a particular direction. Each of your batch is 4 dimensional (batch_size, height, width, channels
). But, you know that the computation should not skip any batch
and nor should it skip any channel
, but what a GPU sees is just a 4D tensor, and hence asks for the stride
along each dimension.
tf.nn.conv2d
is a low-level implementation in Tensorflow, which exposes the GPU API as it is. There is another high-level implementation as well, tf.layers.Conv2d
which only allows you to pass a two element tuple, with height stride
and width stride
. But, if you want to use the low-level API (maybe due to more control over the parameters), you should always keep batch and column stride to 1.