Check the Reproducibility docs 3, which mention additional ops such as torch.use_deterministic_algorithms(). If a non-deterministic operation is found, it should raise an error.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.