torch.set_rng_state¶ torch.set_rng_state(new_state)[source][source]¶ 设置随机数生成器的状态。 注意 此函数仅适用于 CPU。对于 CUDA,请使用 torch.manual_seed() ,它适用于 CPU 和 CUDA。 参数: new_state(torch.ByteTensor)- 所需的状态