torch.cuda.seed_all¶ torch.cuda.seed_all()[原始碼][原始碼]¶ 將所有 GPU 上產生亂數的種子設定為亂數。 如果 CUDA 不可用,呼叫此函式是安全的;在這種情況下,它會被靜默忽略。