Код: Выделить всё
all_lstm_outputs, self.state = tf.compat.v1.nn.dynamic_rnn(
drop_multi_cell, all_inputs, initial_state=tuple(initial_state),
time_major = True, dtype=tf.float32)
Для другого контекста drop_multi_cell = tf.keras.layers.StackedRNNCells(drop_lstm_cells), но мне трудно понять, как код вписывается в последний модуль.
Я тестирую:
Код: Выделить всё
rnn_layer = tf.keras.layers.RNN([drop_multi_cell],
time_major=True)
all_lstm_outputs, self.state = rnn_layer(all_inputs, initial_state=tuple(initial_state))
Для других контекстов
https://www .tensorflow.org/api_docs/python/tf/compat/v1/nn/dynamic_rnn
https://www.tensorflow.org/api_docs/pyt ... layers/RNN
Подробнее здесь: https://stackoverflow.com/questions/778 ... orflow-2-0