Additionally to the already used arguments, you could also set torch.set_deterministic(True) as described in the Reproducibility docs 37 so that an error is raised in case a non-deterministic method is used.