title: keras compute_output_shape not working for Custom layer
body: <p>I customized a layer, merged the batch_size and the first dimension, the other dimensions remained unchanged, but compute_output_shape seemed to have no effect, resulting in the subsequent layer could not get accurate shape information, resulting in an error. How do I make compute_output_shape work?</p>
  
  <pre><code>import keras
  from keras import backend as K
  
  class BatchMergeReshape(keras.layers.Layer):
      def __init__(self, **kwargs):
          super(BatchMergeReshape, self).__init__(**kwargs)
  
      def build(self, input_shape):
          super(BatchMergeReshape, self).build(input_shape)  
  
      def call(self, x):
          input_shape = K.shape(x)
          batch_size, seq_len = input_shape[0], input_shape[1]
          r = K.reshape(x, (batch_size*seq_len,)+input_shape[2:])
          print("call_shape:",r.shape)
          return r
  
      def compute_output_shape(self, input_shape):
          if input_shape[0] is None:
              r = (None,)+input_shape[2:]
              print("compute_output_shape:",r)
              return r
          else:
              r = (input_shape[0]*input_shape[1],)+input_shape[2:]
              return r
  
  a = keras.layers.Input(shape=(3,4,5))
  b = BatchMergeReshape()(a)
  print(b.shape)
  
  # call_shape: (?, ?)
  # compute_output_shape: (None, 4, 5)
  # (?, ?)
  </code></pre>
  
  <p>I need to get (None,4,5) but get (None,None),why compute_output_shape didn't work. My keras version is 2.2.4</p>