如何在Tensorflow中将“fully_connected”图层的输出提供给LSTM图层 . 我正在尝试以下代码:

hidden1 = fully_connected(X, n_hidden1, scope="hidden1")
hidden2 = fully_connected(hidden1, n_hidden2, scope="hidden2")
hidden3 = fully_connected(hidden2, n_hidden3, scope="hidden3")
lstm=tf.contrib.cudnn_rnn.CudnnCompatibleLSTMCell(n_lstm)
initial_state = lstm.zero_state(batch_size, tf.float32)
lstm_outputs, final_state = tf.nn.dynamic_rnn(lstm, hidden3, 
initial_state=initial_state)
output = fully_connected(lstm, n_outputs,scope="outputs",activation_fn=None)

LSTM层需要3D张量作为输入,例如(batch_size,max_time,num_features)但“full_connected”层的输出是1D张量 .

如何实现神经网络,其中LSTM层的输入是Tensorflow中“完全连接”层的输出?

谢谢你的帮助!