Let’s say I have the following model
class Model(nn.Module):

    def __init__(self):
        super().__init__()

        self.conv = torch.nn.Conv2d(in_channels=3, out_channels=4, kernel_size=(3, 3))

    def forward(self, x):
        x = self.conv(x)
        x = torch.flatten(x, start_dim=1)
        x = torch.sigmoid(x)
        return x

Now, if I use
for name, module in model.named_children():
    print(type(module))

only the convolutional operations shows up:
<class 'torch.nn.modules.conv.Conv2d'>
I would like to know, why the flatten() and sigmoid() do not show up?
If I, for example, want to replace in an existing model the flatten() or sigmoid() operation, how do I do that in this case? How can I modify the forward pass?