My take: class RNN(nn.Module) implements just an RNN cell not a complete RNN layer like nn.LSTM or nn.GRU which hide the loop over each time step when you feed them the whole sequence – however, for text generation it’s still common to feed letters or words step by step since you have to have to calculate the loss at each step anyway.
The PyTorch docs for RNN do not apply here since class RNN(nn.Module) is custom code that has nothing to do with nn.RNN of PyTorch.