Thanks for your reply! 
I agree that index labels are more memory efficient, but having different encoders for inputs and labels just made things slightly more difficult.
The flattening of my input was for Cross-Entropy Loss.
In your command, out.view() yields a [1, data_dim] tensor. This won’t pass through CE Loss. You need a .squeeze() to get a 1D tensor. At least that’s how it was for me