Hi @ptrblck, many thanks for your response. It should be obvious and I should have figured it out…
The reason for doing so is that I want my network to have a basic backbone sub-network, and a number of branches (heads). Each head is implemented as an nn.ModuleDict, or even nn.ModuleList for convenience. During forward, an id for which head should be used is given (as a string). If you think that’s not a good practice, please let me know.