torch.xpu.manual_seed#
- torch.xpu.manual_seed(seed)[source]#
设置当前 GPU 随机数生成的种子。
If XPU is not available, calling this function is safe; it will be silently ignored.
- 参数
seed (int) – 期望的种子。
警告
如果您正在使用多 GPU 模型,此函数不足以实现确定性。要设置所有 GPU 的种子,请使用
manual_seed_all()
。