The functional operations used in the forward method are not registered as modules and thus won’t show up in model.modules() or model.children().



 Samue1:

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?


You can directly modify the forward method and replace these operations.
In case you want to manipulate the forward of another pre-defined model, you could derive a custom model from it and implement your forward there.