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