torch.cuda.seed_all¶ torch.cuda.seed_all()[source][source]¶ 将生成随机数的种子设置为所有 GPU 上的随机数。 如果 CUDA 不可用,可以安全地调用此函数;在这种情况下,它会被静默忽略。