torch.xpu.manual_seed¶ torch.xpu.manual_seed(seed)[原始碼][原始碼]¶ 設定目前 GPU 產生隨機數字的種子。 如果 XPU 無法使用,可以安全地呼叫此函式;在這種情況下,它會被靜默地忽略。 參數 seed (int) – 想要的種子。 警告 如果您正在使用多 GPU 模型,則此函式不足以獲得確定性。要為所有 GPU 播種,請使用 manual_seed_all()。