If you would like to use the output of enc(output) as the target only and it thus wouldn’t require gradients, I think both methods would work.
Feel free to correct me, in case I misunderstood the use case.