Could you save an example tensor for sample['gt'] as well as mu and post an executable code snippet to reproduce the difference you are seeing?
Maybe you could also post a way to randomly initialize both tensors to recreate the issue.