class Model(nn.Module):
    ##Layer Composition
    def __init__(self):
        super(Model, self).__init__()

        #Layer Block-1
        self.cv1    = nn.Conv2d(kernel_size=(CV1_K_H, CV1_K_W), in_channels= CV1_K_C, out_channels=CV2_K_C, stride=CV1_STRIDE, dilation=CV1_DILATION, bias=CV1_BIAS)
        self.pl1    = nn.AvgPool2d(kernel_size=(PL1_K_H, PL1_K_W), stride=PL1_STRIDE)

        #Layer Block-2
        self.cv2    = nn.Conv2d(kernel_size=(CV2_K_H, CV2_K_W), in_channels=CV2_K_C, out_channels=CV3_K_C, stride=CV2_STRIDE, dilation=CV2_DILATION, bias=CV2_BIAS)
        self.pl2    = nn.AvgPool2d(kernel_size=(PL2_K_H, PL2_K_W), stride=PL2_STRIDE)

        #Layer Block-3
        self.cv3    = nn.Conv2d(kernel_size=(CV3_K_H, CV3_K_W),in_channels=CV3_K_C, out_channels=CV3_K_C, stride=CV3_STRIDE, dilation=CV3_DILATION, bias=CV3_BIAS)
        self.pl3    = nn.AvgPool2d(kernel_size=(PL3_K_H, PL3_K_W), stride=PL3_STRIDE)

        #Layer Block-4
        self.fc1    = nn.Linear(in_features=FC1_SIZE_IN out_features=FC1_SIZE_OUT, bias=FC1_BIAS)
        self.fc2    = nn.Linear(in_features=FC2_SIZE_IN, out_features=FC2_SIZE_OUT, bias=FC2_BIAS)
        self.fc3    = nn.Linear(in_features=FC3_SIZE_IN, out_features=FC3_SIZE_OUT, bias=FC3_BIAS)


    def forward(self, image):
        #Layer Block-1
        b1_cv       = torch.relu(self.cv1(image))
        b1_pl       = self.pl1(b1_cv)

        #Layer Block-2
        b2_cv       = torch.relu(self.cv2(b1_pl))
        b2_pl       = self.pl2(b2_cv)    

        #Layer Block-3
        b3_cv       = torch.relu(self.cv3(b2_pl))
        b3_pl       = self.pl3(b3_cv)    

        #Flattening to feed into fully connection
        flattened   = torch.flatten(b3_pl, start_dim=1)

        b4_fc1      = torch.relu(self.fc1(flattened))
        b4_fc2      = torch.relu(self.fc2(b4_fc1))
        b4_fc3      = torch.relu(self.fc3(b4_fc2))

        return b4_fc3

↑ @ptrblck this is full code.