torch.cuda.manual_seed_all¶ torch.cuda.manual_seed_all(seed)[原始碼][原始碼]¶ 設定所有 GPU 上產生亂數的種子 (seed)。 即使 CUDA 不可用,呼叫此函數也是安全的;在這種情況下,它會被默默地忽略。 參數 seed (int) – 期望的種子 (seed)。