diff --git a/edward2/tensorflow/layers/recurrent.py b/edward2/tensorflow/layers/recurrent.py index c4df8448..179a7cc8 100644 --- a/edward2/tensorflow/layers/recurrent.py +++ b/edward2/tensorflow/layers/recurrent.py @@ -151,6 +151,8 @@ def call_weights(self): self.recurrent_kernel = self.recurrent_initializer( self.recurrent_kernel.shape, self.dtype) if isinstance(self.bias_initializer, tf.keras.layers.Layer): + if self.bias is None: + raise ValueError('self.bias is None.') self.bias = self.bias_initializer(self.bias.shape, self.dtype) self.called_weights = True