Use `copy` to manage shape duplicate in Bidirectional
@@ -286,12 +286,12 @@ class Bidirectional(Wrapper):
output_shape[-1] *= 2
output_shape = tuple(output_shape)
elif self.merge_mode is None:
- output_shape = [output_shape] * 2
+ output_shape = [output_shape, copy.copy(output_shape)]
if self.return_state:
if self.merge_mode is None:
- return output_shape + state_shape * 2
- return [output_shape] + state_shape * 2
+ return output_shape + state_shape + copy.copy(state_shape)
+ return [output_shape] + state_shape + copy.copy(state_shape)
return output_shape
def call(self, inputs, training=None, mask=None, initial_state=None):
