Skip to content

Commit

Permalink
Add an input validation case in Concatenate.
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Jan 9, 2018
1 parent f0872fc commit a4c1d44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras/layers/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ def __init__(self, axis=-1, **kwargs):

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]
Expand Down

0 comments on commit a4c1d44

Please sign in to comment.