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