torch.xpu.manual_seed#
- torch.xpu.manual_seed(seed)[原始碼]#
設定當前 GPU 隨機數生成的種子。
If XPU is not available, calling this function is safe; it will be silently ignored.
- 引數
seed (int) – 期望的種子。
警告
如果您正在處理多 GPU 模型,此函式不足以獲得確定性。要設定所有 GPU 的種子,請使用
manual_seed_all()。