Thank you for the link.
I tried to add:
torch.manual_seed(0)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False

But I still get two different outputs.
If I understand it correctly, the problem might be

floating-point addition is not perfectly associative for floating-point operands

Hence, the non-deterministic function?