My net:
class convNet(nn.Module):
    #constructor
    def __init__(self):
        super(convNet, self).__init__()
        #defining layers in convnet
        #input size=32x32x3
        self.conv1 = nn.Conv2d(1, 96, kernel_size=3,stride=1,padding=1)
        #conv1: 28x28x1 -> 28x28x96
        self.conv2 = nn.Conv2d(96, 256, kernel_size=3,stride=1,padding=1)
        #conv2: 28x28x96 -> 28x28x256
        self.conv3 = nn.Conv2d(256,384,kernel_size=3,stride=1,padding=1)
        #conv3: 28x28x256 -> 28x28x384
        #pooling: 28x28x384 -> 14x14x384
        self.conv4 = nn.Conv2d(384,512,kernel_size=3,stride=1,padding=1)
        #conv4: 14x14x384 -> 14x14x512
        #pooling: 14x14x512 -> 7x7x512        
        self.fc1   = nn.Linear(7*7*512, 300)
        self.fc2   = nn.Linear(300, 100)
        self.fc3   = nn.Linear(100, 10)
    
def forward(self, x):
    conv1_relu = nnFunctions.relu(self.conv1(x))
    conv2_relu = nnFunctions.relu(self.conv2(conv1_relu))
    conv3_relu =nnFunctions.max_pool2d(nnFunctions.relu(self.conv3(conv2_relu)),2)
    conv4_relu =nnFunctions.max_pool2d(nnFunctions.relu(self.conv4(conv3_relu)),2)

    x = conv4_relu.view(-1, 7*7*512)
    x = nnFunctions.relu(self.fc1(x))
    x = nnFunctions.relu(self.fc2(x))
    x = self.fc3(x)
    return x

I have an image of 1x28x28 and I am feeding it to the above net.
But it gives me the following error:
RuntimeError: CHECK_ARG((long)pad.size() == input->nDimension - 2) failed at torch/csrc/cudnn/Conv.cpp:258