Let me try to elaborate what is my goal Consider an example of Lenet - 5
class Net(nn.Module):
    
    def __init__(self):
        
        super(Net,self).__init__()
        self.conv1=nn.Conv2d(1,6,5)
        self.conv2=nn.Conv2d(6,16,5)
        self.fc1 = nn.Linear(400,120)
        self.fc2 = nn.Linear(120,84)
        self.classifier = nn.Linear(84,10)
        self.features = nn.Sequential(*list(self.children()))


    



    def forward(self,x):
        x = F.max_pool2d(F.relu(self.conv1(x)),2)
        x = F.max_pool2d(F.relu(self.conv2(x)),2)
        x = x.view(-1, self.num_flat_features(x))
        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))
        #x = x.view(x.size(0), -1)
        x = self.classifier(x)
        return x


    def num_flat_features(self,x):
        size = x.size()[1:]
        num_features = 1
        for s in size:
            num_features*=s
        return num_features

model = torch.load('lenet5.pth')
#print(model.values())

model_new = Net()    # before loading trained weights




model_new.load_state_dict(torch.load('lenet5.pth'))  # After loading trained w

with torch.no_grad():
	correct = 0
	total = 0
	for images,labels in test_loader:
		#images = images.reshape(-1,28*28)
		out = model_new(images)
		_,predicted = torch.max(out.data,1)
		total += labels.size(0)
		correct += (predicted==labels).sum().item()
		print('Accuracy of the network on the 10000 test images: {} %'.format(100 * correct / total))




I am suppose to check accuracy of the network after substituting the nn.conv2d multiplication/addition using my two functions mymult(num1,num2) and myadd(num1,num2). The same has to be done with some other already trained neural networks. This is a short example, we can even choose them from inside pytorch too.