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