From c678bdb3ae128974ddcc06bc02c5ae5f0de65e24 Mon Sep 17 00:00:00 2001 From: George Sterpu Date: Fri, 10 Jan 2020 12:34:40 +0000 Subject: [PATCH] Update recurrent.py trying to edit directly from the browser --- tensorflow/python/keras/layers/recurrent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/keras/layers/recurrent.py b/tensorflow/python/keras/layers/recurrent.py index 6c7610b6795..3a07fbc1694 100644 --- a/tensorflow/python/keras/layers/recurrent.py +++ b/tensorflow/python/keras/layers/recurrent.py @@ -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)