Update recurrent.py

This commit is contained in:
George Sterpu 2020-01-10 12:37:51 +00:00 committed by GitHub
parent c678bdb3ae
commit 409db98338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,10 +388,10 @@ class RNN(Layer):
**kwargs):
if isinstance(cell, (list, tuple)):
cell = StackedRNNCells(cell)
if not hasattr(cell, 'call'):
if not 'call' in dir(cell):
raise ValueError('`cell` should have a `call` method. '
'The RNN was passed:', cell)
if not ('state_size' in dir(cell) or hasattr(cell, 'state_size')):
if not 'state_size' in dir(cell):
raise ValueError('The RNN cell should have '
'an attribute `state_size` '
'(tuple of integers, '