I tried your code then I found a strange problem!! If I pass torch.zeros(32, 28*28), it can work. But!! If passing (64, 28*28), it hangs. This problem doesn’t happen on my macbook, But happened on Linux PC.