title: Tensorflow output from stride
body: <p>While trying to use Tensorflow I encountered a little problem regarding the stride.</p>
  
  <p>I have an image of size 67*67, and I want to apply a filter of size 7*7 with stride 3. The output layer should have an edge length of 20 calculated from:</p>
  
  <p><img src="https://chart.googleapis.com/chart?cht=tx&amp;chl=7%20%2B%203(n%2B1)%20%3D67" alt="formula"></p>
  
  <p>Where <em>n</em> is the output layer edge length (in this case, 20). It is calculated in the follow way:</p>
  
  <blockquote>
    <p>If we only consider the first row (since other rows are the same), then out of the 67 elements in the first row, the first 7 would go to the first cell of the output layer. Then the filter moves 3 element to the right, which makes the filter covering element 4 to 10, and that would correspond to the 2nd element of the output layer. So on so forth. Every time we advance 3 elements and the total number of times we will advance (counting the first step where it covers 7 elements) is <em>n</em>. Thus the equation I used.</p>
  </blockquote>
  
  <p>However, the output layer I got from Tensorflow was 23, which is 67/3 and rounded up to the next integer. I don't understand the reasoning behind this. </p>
  
  <p>Can someone explain why it is done like this in Tensorflow?</p>
  
  <p>Thanks!</p>