Something I really don’t understand is whether RNN are unrolled or not and how to choose. In Keras with Theano backend you can specify unroll = True or False depending on the memory vs speed tradeoff you want to make.
By the way in the specific case described here, whatever the rolling status of the LSTM, the memory consumption will grow due to the output you use:
net_out = nn.Linear(in_features=HIDDEN_SIZE, out_features=INPUT_SIZE)
Indeed :
print(net_out)
Gives :
Linear (512 -> INPUT_SIZE)