text_plain_output_1.png
acts = hook_a.stored[0].cpu()
acts.shape

grad = hook_g.stored[0][0].cpu()
grad.shape

grad_chan = grad.mean(1).mean(1)
grad_chan.shape

mult = F.relu((acts * grad_chan[..., None, None]).sum(0))
mult.shape