Why would forward hooks be needed for this case? I was thinking I could use the encode function just to get a latent representation then detach it from the device for processing further. Are forward hooks used for good practice or is it a memory requirement when dealing with tensors for this type of case?