This is very helpful. Thank you.
I note that both x and y are returning the same  item. Shouldn’t y be the next item in the series to  train LSTM.
x
tensor([[[  1.,  10.,  11.,  15.,   9., 100.],
         [  2.,  11.,  12.,  16.,   9., 100.]]])

y
tensor([[[  3.,  12.,  13.,  17.,   9., 100.]]])
         

I’m struggling to get guidance on what the shape of target should be.
I’ve trying to amend this code to return x and y  but getting errors everywhere.