Solved by jmandivarapu1 in post #3 
              
              
                import torch.nn as nn

class ModelA(nn.Module):
    def __init__(self,n_channels):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 6, 5)
        self.pool = nn.MaxPool2d(2, 2)
        self.conv2 = nn.Conv2d(6, 16, 5)
        self.fc1 = nn.Linear(16 * 5 * 5, 120)
        self.fc2 = nn.Li…