Set zero_output_for_mask in tf.keras.layers.Bidirectional only when return_sequences=True.
Previously, Bidirectional would always force zero_output_for_mask=True. However, this made it difficult to get just the last output from the layer when using masked sequences - if return_sequences=False, the last output for the forward RNN would be zeros. PiperOrigin-RevId: 236009388
Loading
Please sign in to comment