Although I don’t know what you’re trying to do, but nn.RNN needs inputs to be 3 dimensions.
https://pytorch.org/docs/stable/nn.html#torch.nn.RNN 19

Inputs: input, h_0
input of shape (seq_len, batch, input_size): tensor containing the features of the input sequence. The input can also be a packed variable length sequence. See torch.nn.utils.rnn.pack_padded_sequence() or torch.nn.utils.rnn.pack_sequence() for details.