test_tf_util.py 文件源码

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

项目:combine-DT-with-NN-in-RL 作者: Burning-Bear 项目源码 文件源码
def test_set_value():
    a = tf.Variable(42.)
    with single_threaded_session():
        set_value(a, 5)
        assert a.eval() == 5
        g = tf.get_default_graph()
        g.finalize()
        set_value(a, 6)
        assert a.eval() == 6

        # test the test
        try:
            assert a.eval() == 7
        except AssertionError:
            pass
        else:
            assert False, "assertion should have failed"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号