If there are pre_forward
and forward
hooks set on two different instances of subclasses of torch.nn.module.Module
from the main thread, is there any circumstances in which the following order of calling could occur?
mod1_pre_forward -> mod2_pre_forward -> mod1_forward -> mod2_forward
That is to say-- if the forward pre-hook of module 1 is called before the forward hook of module 2 and the forward post-hook of module 1 has not yet been called, is there any circumstance in which the forward post-hook of module 1 will be called before the forward post-hook of module 2?