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