From 409db98338a62808209ab3837f6ca3b796c81dc5 Mon Sep 17 00:00:00 2001 From: George Sterpu Date: Fri, 10 Jan 2020 12:37:51 +0000 Subject: [PATCH] Update recurrent.py --- 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 3a07fbc1694..22d7cd4dcf9 100644 --- a/tensorflow/python/keras/layers/recurrent.py +++ b/tensorflow/python/keras/layers/recurrent.py @@ -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, '