Hi,
Thanks for your answer. But I think you misunderstood my question. I will try to repost in a unambiguous way.
class MobileNet(nn.Module):
    # (128,2) means conv planes=128, conv stride=2, by default conv stride=1
    cfg = [64, (128,2), 128, (256,2), 256, (512,2), 512, 512, 512, 512, 512, (1024,2), 1024]

    def __init__(self, depth_mul = 1.0, num_classes=1000):
        super(MobileNet, self).__init__()
        self.depth_mul = depth_mul
        self.conv1 = nn.Conv2d(3, 32, kernel_size=3, stride=2, padding=1, bias=False)
        self.bn1 = nn.BatchNorm2d(32)
       # Position 1 of self.relu = nn.ReLU(inplace=True)
        self.layers = self._make_layers(in_planes=32)
        ## Postion 2 of self.relu = nn.ReLU(inplace=True)
        self.linear = nn.Linear(int(1024 * self.depth_mul), num_classes)
        self.avgpool = nn.AvgPool2d(7)
    def _make_layers(self, in_planes):
        layers = []
        for x in self.cfg:
            out_planes = int(x * self.depth_mul) if isinstance(x, int) else int(x[0]*self.depth_mul)
            stride = 1 if isinstance(x, int) else x[1]
            layers.append(Block(in_planes, out_planes, stride))
            in_planes = out_planes
        return nn.Sequential(*layers)

    def forward(self, x):
        out = self.relu(self.bn1(self.conv1(x)))
        out = self.layers(out)
        out = self.avgpool(out)
        out = torch.flatten(out, start_dim=1)
        out = self.linear(out)
        return out

When ReLU is defined at position 1, the nn.ReLU is printed but when ReLU is defined at position 2, the nn.ReLU is not printed while calling the print(net).
I am referring to __init__() in class MobileNet() and not class Block().
Apologies for all confusions. Thanks in advance for all replies.