In pytorch the order of dimensions are b-c-l with:


b is the “mini batch” dimension

c is the “channel” or the actual dimension of each 1d point

l is the length of your c-dimensional signal.
In your case, you have a single example, thus b=1. You have 1024 samples, thus l=1024 and the dimension of each point is 1, thus c=1.
Pytorch expects your 1024x1 input to actually be of size 1x1x1024.
Use view and transpose to get from 1024x1 to 1x1x1024 and you should be okay.