title: Issue with Keras backend flatten
body: <p>Why does Keras.backend.flatten not show proper dimension? I have the following:</p>
  
  <p>x is &lt;tf.Tensor 'concat_8:0' shape=(?, 4, 8, 62) dtype=float32&gt;</p>
  
  <p>After:</p>
  
  <pre><code>Keras.backend.flatten(x)
  </code></pre>
  
  <p>x becomes: &lt;tf.Tensor 'Reshape_22:0' <strong>shape=(?,)</strong> dtype=float32&gt;</p>
  
  <p><strong>Why is x not of shape=(?, 4*8*62)</strong></p>
  
  <p><strong>EDIT-1</strong></p>
  
  <p>I get (?, ?) if I use <code>batch_flatten</code> (<code>branch3x3</code> &amp; <code>branch5x5</code> below are tensors from previous convolutions):</p>
  
  <pre><code>x = Lambda(lambda v: K.concatenate([v[0], v[1]], axis=3))([branch3x3, branch5x5])
  x = Lambda(lambda v: K.batch_flatten(v))(x)
  </code></pre>
  
  <p>Result of first Lambda is &lt;tf.Tensor 'lambda_144/concat:0' shape=(?, 4, 8, 62) dtype=float32></p>
  
  <p>Result of second Lambda is &lt;tf.Tensor 'lambda_157/Reshape:0' shape=(?, ?) dtype=float32></p>
  
  <p><strong>EDIT-2</strong></p>
  
  <p>Tried <code>batch_flatten</code> but get an error downstream when I build the model output (using <code>reshape</code> instead of <code>batch_flatten</code> seems to work). <code>branch3x3</code> is &lt;tf.Tensor 'conv2d_202/Elu:0' shape=(?, 4, 8, 30) dtype=float32>, and <code>branch5x5</code> is &lt;tf.Tensor 'conv2d_203/Elu:0' shape=(?, 4, 8, 32) dtype=float32>:</p>
  
  <pre><code>from keras import backend as K
  x = Lambda(lambda v: K.concatenate([v[0], v[1]], axis=3))([branch3x3, branch5x5])
  x = Lambda(lambda v: K.batch_flatten(v))(x)
  y = Conv1D(filters=2, kernel_size=4)(Input(shape=(4, 1)))
  y = Lambda(lambda v: K.batch_flatten(v))(y)
  z = Lambda(lambda v: K.concatenate([v[0], v[1]], axis=1))([x, y])
  output = Dense(32, kernel_initializer=TruncatedNormal(), activation='linear')(z)
  cnn = Model(inputs=[m1, m2], outputs=output)
  </code></pre>
  
  <p>The <code>output</code> statement results in the following error for the <code>kernel_initializer</code>: <strong>TypeError: Failed to convert object of type  to Tensor. Contents: (None, 32). Consider casting elements to a supported type.</strong></p>