The builtin pytorch loss functions take the average loss per sample, so you don’t have to adjust the learning rate for a different batch size.
One thing to note is that nn.LSTM expects input of shape (timesteps, batch_size, features). If you want to give input of shape (batch_size, timesteps, features) then you will need to use the batch_first=True argument to nn.LSTM, or alternatively you can use input.transpose(0,1) to switch the first two dimensions.