if not self.stateful:
raise AttributeError("Layer must be stateful.")
if not self.input_spec:
raise RuntimeError("Layer has never been called "
"and thus has no states.")
batch_size = self.input_spec.shape[0]
if not batch_size:
raise ValueError("If a RNN is stateful, it needs to know "
"its batch size. Specify the batch size "
After Change
str(values))
for index, (value, state) in enumerate(zip(states, self.states)):
if value.shape != (batch_size, self.units):
raise ValueError("State " + str(index) +
" is incompatible with layer " +
self.name + ": expected shape=" +
str((batch_size, self.units)) +