How to solve “TypeError: forward() takes 2 positional arguments but 3 were given” in PyTorch CNN architecture I am using MNIST to train a CNN using the following code: