When Trainer(deterministic=True) then the implementation should invoke torch.use_deterministic_algorithms(True) under the hood, otherwise there is a chance that the underlying code will be non-deteministic.
Source: https://pytorch.org/docs/stable/generated/torch.use_deterministic_algorithms.html