This is because
te = torch.ones([1, 10], requires_grad=True)

creates the leaf variable (which will receive the grad) and
te = te.cuda(device='cuda:0')

will assign something else (a non-leaf variable) to the name te.
If you do
   te = torch.ones([1, 10], requires_grad=True)
   tec = te.cuda(device='cuda:0')
   output = mod(tec)

instead, you keep the name of the original you’ll get the same as in the reco variant.
Best regards
Thomas