It seems that copy.deepcopy(module) is recommended for cloning a module without parameter sharing.
Then, what would be the best approach for cloning with parameter sharing?
I mean, weights and grads will be automatically shared if we just forward the module with different inputs and dealing with the outputs. However, if there are other non-module variables that I want to share, I am not sure what would be the most elegant way.
Thanks!