From 223136f0838ff808302f5b97c64321b3969cce33 Mon Sep 17 00:00:00 2001 From: Edward2 Team Date: Mon, 9 Dec 2024 06:31:44 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 704263127 --- edward2/tensorflow/layers/recurrent.py | 2 ++ 1 file changed, 2 insertions(+) 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