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