Thanks for the confirmation/advice @ptrblck. I’m not calculating a similarity, but am calculating a correlation between intermediate feature maps. And, yes, the hooks appeared to work. I was concerned that gradients in one leg were being overwritten, but that doesn’t seem to be the case.