title: Keras: How to make average/maximum operation on top of some layers results?
body: <p>I design neural network with the dynamic amount of inputs. My idea is to process set of data with shared model, then average/maximum their results and place classifier on top of it.
  After reading documentation i was sure that it is possible using Keras, but i faced problem that <code>keras.layers.average</code> can receive only input tensors. But i need to make this operation over models or other layers instead.</p>
  
  <p>Here is code i have now</p>
  
  <pre><code>inputs = [Input((countInputCount,))]  # count is always here
  downs = []
  for i in range(count):
          inputs.append(Input((inputCount,)))
          downs.append(sharedDown(inputs[-1]))
  avg = keras.layers.average(downs)
  max = keras.layers.maximum(downs)
  middle = keras.layers.concatenate([inputs[0], avg, max])
  </code></pre>
  
  <p>For this i got next error: <code>ValueError: A merge layer should be called on a list of inputs.</code></p>
  
  <p>Probably i understand this error incorrectly. Any help will be highly appreciated.</p>
  
  <p>Thank you.</p>