title: Why is the x variable tensor reshaped with -1 in the MNIST tutorial for tensorflow?
body: <p>I'm following the TensorFlow tutorial</p>
  <p>Initially <code>x</code> is defined as</p>
  <pre class="lang-py prettyprint-override"><code>x = tf.placeholder(tf.float32, shape=[None, 784])
  </code></pre>
  <p>Later on it reshapes <code>x</code>, I'm trying to understand why.</p>
  <blockquote>
  <p>To apply the layer, we first reshape x to a 4d tensor, with the second and third dimensions corresponding to image width and height, and the final dimension corresponding to the number of color channels.</p>
  </blockquote>
  <pre class="lang-py prettyprint-override"><code>x_image = tf.reshape(x, [-1,28,28,1])
  </code></pre>
  <p>What does -1 mean in the reshaping vector and why is <code>x</code> being reshaped?</p>