title: Understanding input/output tensors from tf.layers.conv2d
body: <p>I'm trying to understand the transformation performed by <code>tf.layers.conv2d</code>.</p>
  <p>The mnist tutorial code from the TensorFlow website includes the convolution layer:</p>
  <pre><code># Computes 64 features using a 5x5 filter.
  # Padding is added to preserve width and height.
  # Input Tensor Shape: [batch_size, 14, 14, 32]
  # Output Tensor Shape: [batch_size, 14, 14, 64]
  conv2 = tf.layers.conv2d(
      inputs=pool1,
      filters=64,
      kernel_size=[5, 5],
      padding=&quot;same&quot;,
      activation=tf.nn.relu)
  </code></pre>
  <p>However, my expectation is that the 32 input images would be multiplied by the number of filters, as each filter is applied to each image, to give an output tensor of <code>[batch_sz, 14, 14, 2048]</code>. Clearly this is wrong, but I don't know why. How does the transformation work? The API documentation tells me nothing about how it works. What would be the output if the input tensor was <code>[batch_size, 14, 14, 48]</code>?</p>