Pytorch use nondeterministic algoritm
This code uses APIs with nondeterministic operations by default which could affect reproducibility. Use torch.use_deterministic_algorithms(True) to ensure deterministic algorithms are used.
def pytorch_use_nondeterministic_algorithm_noncompliant():
    import torch
    # Noncompliant: `torch.bmm` doesn't use deterministic algorithms
    # by default.
    torch.bmm(torch.randn(2, 2, 2).to_sparse().cuda(),
              torch.randn(2, 2, 2).cuda())
def pytorch_use_nondeterministic_algorithm_compliant():
    import torch
    # Compliant: configure `torch.bmm` to use deterministic algorithms.
    torch.use_deterministic_algorithms(True)
    torch.bmm(torch.randn(2, 2, 2).to_sparse().cuda(),
              torch.randn(2, 2, 2).cuda())