test_tf_util.py 文件源码

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

项目:combine-DT-with-NN-in-RL 作者: Burning-Bear 项目源码 文件源码
def test_multikwargs():
    tf.reset_default_graph()
    x = tf.placeholder(tf.int32, (), name="x")
    with tf.variable_scope("other"):
        x2 = tf.placeholder(tf.int32, (), name="x")
    z = 3 * x + 2 * x2

    lin = function([x, x2], z, givens={x2: 0})
    with single_threaded_session():
        initialize()
        assert lin(2) == 6
        assert lin(2, 2) == 10
        expt_caught = False
        try:
            lin(x=2)
        except AssertionError:
            expt_caught = True
        assert expt_caught
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号