Add an input validation case in Concatenate.
@@ -330,9 +330,9 @@ class Concatenate(_Merge):
def build(self, input_shape):
# Used purely for shape validation.
- if not isinstance(input_shape, list):
+ if not isinstance(input_shape, list) or len(input_shape) < 2:
raise ValueError('`Concatenate` layer should be called '
- 'on a list of inputs')
+ 'on a list of of at least 2 inputs')
if all([shape is None for shape in input_shape]):
return
reduced_inputs_shapes = [list(shape) for shape in input_shape]
