That works perfectly! I’ll make sure to keep the forward pass restricted to an encoder and decoder to avoid any problems.
I’m unfamiliar with the use of hooks but from your code in the link and your description here I get the idea…it will only be necessary to use the hooks method if the problem requires using more in the forward pass I assume.
Many thanks as always!