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