Solved by Roj in post #6 
              
              
                Aha! I knew it had to be something silly. On my local machine, I imported the standard MNIST dataset in which the 28x28 pixel arrays are already flattened to 1d arrays of size 784, so this returned: 
x shape =  torch.Size([50000, 784])
w shape = torch.Size([784, 10])

as expected. In contrast, since…