评价此页

torch.xpu.seed#

torch.xpu.seed()[源代码]#

将当前 GPU 随机数生成的种子设置为一个随机数。

If XPU is not available, calling this function is safe; it will be silently ignored.

警告

如果您正在处理多 GPU 模型,此函数将仅在一个 GPU 上初始化种子。要初始化所有 GPU,请使用 seed_all()