torch.xpu.manual_seed_all torch.xpu.manual_seed_all(seed)[源代码] 为所有GPU上的随机数生成设置种子。 如果 XPU 不可用,调用此函数是安全的;此时该函数会被静默忽略。 参数 seed (int) – 指定的随机种子值。