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