I checked the two links and the implementation of the UnetSkipConnectionBlock. Unfortunately I cannot really tell what your are trying to do and what your self.model actually implements. Could you elaborate more and share some code?
I want to pass the ‘activation’ and ‘hook_idx’ variables to each UnetSkipConnectBlock so that it can be accessed at each layer and modified. The parameters are common for every (UnetSkipConnectBlock) layer. I think if I make down, up and submodule (in UnetSkipConnectBlock) global and change it in forward pass (of UnetSkipConnectBlock) it will work…? Currently trying something similar…
If you register the hooks to the other network, would’t that do the job? You would be able to access the activation dictionary (which is global) and index it by setting the name you want when you register the hook.
Since the blocks of the 2 models have the same name, they will index the same activation in the dictionary. Then, if you want to modify it in a way that is not overriding, you can just adapt the hook logic accordingly.