title: Output shape of tf.nn.conv2d_transpose is entirely undefined even though only batch size unknown
body: <p>I am using the following code to compute a 2D deconvolution in Tensorflow:</p>
  
  <pre><code>def deconv2d_strided(input_, filter_h, filter_w, channels_in, channels_out, output_shape,
                       pool_factor=2, name='deconv', reuse=False):
      with tf.variable_scope(name, reuse=reuse):
          w = tf.get_variable(...)
          b = tf.get_variable(...)
          minus_b = tf.subtract(input_, b)
  
          # dynamic shape of input_:
          in_shape = tf.shape(input_)
          out_shape = [in_shape[0], output_shape[0].value, output_shape[1].value, channels_out]
          out = tf.nn.conv2d_transpose(minus_b,
                                       filter=w,
                                       output_shape=tf.pack(out_shape),
                                       strides=[1, pool_factor, pool_factor, 1],
                                       padding='SAME')
          return out
  </code></pre>
  
  <p>The problem I'm facing is that the shape of <code>out</code> looks like <code>shape=(?, ?, ?, ?)</code> even though the <code>out_shape</code> I pass into the function is fully defined except for the first dimension (which is the batch size). I.e.</p>
  
  <pre><code>out_shape = &lt;class 'list'&gt;: [&lt;tf.Tensor 'decoder/conv_l4/strided_slice:0' shape=() dtype=int32&gt;, 5, 15, 256]
  </code></pre>
  
  <p>How can I get the shape of <code>out</code> to look like <code>(?, 5, 15, 256)</code>?</p>
  
  <p>I want the shape to be defined as fully as possible, because the output of this is going into a batch normalization layer, and for this to work, the channels dimension (which is the last) must be fully defined otherwise Tensorflow complains (cf. <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/layers/python/layers/layers.py" rel="nofollow noreferrer"><code>tf.contrib.layers.python.layers.batch_norm</code></a>). So, if you have a solution how I can pass a tensor with undefined channel dimension into the batch normalization layer, that would also work for me, though I would prefer to get this thing right and figure out why the output shape of <code>conv2d_transpose</code> is undefined.</p>