That’s strange. It’s working in this case:
class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(3, 6, 3)
        self.conv2 = nn.Conv2d(6, 12, 3)
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        return x

net = Net()
...
# Print the shape