title: How to get the batch size inside lambda layer
body: <p>I'm trying to implement a layer (via lambda layer) which is doing the following numpy procedure:</p>
  
  <pre><code>def func(x, n):
      return np.concatenate((x[:, :n], np.tile(x[:, n:].mean(axis = 0), (x.shape[0], 1))), axis = 1)
  </code></pre>
  
  <p>I'm stuck because I don't know how to get the size of the first dimension of x (which is the batch size). The backend function <code>int_shape(x)</code> returns <code>(None, ...)</code>.</p>
  
  <p>So, if I know the batch_size, the corresponding Keras procedure would be:</p>
  
  <pre><code>def func(x, n):
      return K.concatenate([x[:, :n], K.tile(K.mean(x[:, n:], axis=0), [batch_size, 1])], axis = 1)
  </code></pre>