torch.cuda.get_rng_state¶ torch.cuda.get_rng_state(device='cuda')[原始碼][原始碼]¶ 傳回指定 GPU 的亂數產生器狀態,以 ByteTensor 形式傳回。 參數 device (torch.device 或 int, 選用) – 要返回 RNG 狀態的裝置。預設值:'cuda' (即 torch.device('cuda'),目前的 CUDA 裝置)。 返回類型 Tensor 警告 此函數會立即初始化 CUDA。