Update recurrent.py

trying to edit directly from the browser
This commit is contained in:
George Sterpu 2020-01-10 12:34:40 +00:00 committed by GitHub
parent 4ab6a520c9
commit c678bdb3ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,10 +79,10 @@ class StackedRNNCells(Layer):
def __init__(self, cells, **kwargs):
for cell in cells:
if not hasattr(cell, 'call'):
if not 'call' in dir(cell):
raise ValueError('All cells must have a `call` method. '
'received cells:', cells)
if not ('state_size' in dir(cell) or hasattr(cell, 'state_size')):
if not 'state_size' in dir(cell):
raise ValueError('All cells must have a '
'`state_size` attribute. '
'received cells:', cells)