torch.cuda.set_rng_state¶ torch.cuda.set_rng_state(new_state, device='cuda')[原始碼][原始碼]¶ 設定指定 GPU 的隨機數字產生器狀態。 參數 new_state (torch.ByteTensor) – 期望的狀態 device (torch.device 或 int, optional) – 要設定 RNG 狀態的裝置。預設值:'cuda' (即 torch.device('cuda'),目前的 CUDA 裝置)。