why set return_sequences=True and stateful=True for tf.keras.layers.LSTM?
问题 I am learning tensorflow2.0 and follow the tutorial. In the rnn example, I found the code: def build_model(vocab_size, embedding_dim, rnn_units, batch_size): model = tf.keras.Sequential([ tf.keras.layers.Embedding(vocab_size, embedding_dim, batch_input_shape=[batch_size, None]), tf.keras.layers.LSTM(rnn_units, return_sequences=True, stateful=True, recurrent_initializer='glorot_uniform'), tf.keras.layers.Dense(vocab_size) ]) return model My question is: why the code set the argument return