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