test_environment.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:nmtrain 作者: philip30 项目源码 文件源码
def test_random_gpu(self):
    environment.init_gpu(0)
    environment.init_random(self.seed)
    self.assertAlmostEqual(float(environment.array_module().random.random()),
                           0.5405254640354904)
    # TODO(philip30):
    # Seems that the cuda.cupy.random draws from a different distribution than
    # the one in numpy. For now it is important to first init all model using
    # One of the module and convert to the other to ensure that it is producing
    # the same result every time training is conducted
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号