# building a 2-layer LSTM for time series prediction using tensorflow

From Tensorflow tutorials i am experimenting time series with LSTM

In the section 'multi-step prediction' using LSTM tutorial says

Since the task here is a bit more complicated than the previous task, the model now consists of two LSTM layers. Finally, since 72 predictions are made, the dense layer outputs 72 predictions.

where previous task was prediction over a single point.

How do we know how many layers a problem requires (here, 2) ?

Then, from implementation point of view, using Python Tensorflow library,

multi_step_model = tf.keras.models.Sequential()
return_sequences=True,
input_shape=x_train_multi.shape[-2:]))

why is there a need for the adding a Dense(72) layer ? what is the function Dense() doing ? (reading the doc doesn't help really)