Solved by kris-singh in post #7 
              
              
                I was able to resolve the issue. This is the code that works. 
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data.sampl…