首页 > 编程知识 正文

初始化产生随机数的种子,固定随机数种子

时间:2023-05-03 11:53:21 阅读:177632 作者:1326

definit_seed(seed ) :

random.seed(seed ) )。

OS.environ [ ' pythonhashseed ' ]=str (seed )

NP.Random.seed(seed ) )。

torch.manual_seed(seed )

torch.cuda.manual_seed(seed )

torch.cuda.manual _ seed _ all (seed )

torch.backends.Cu dnn.deterministic=true

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。