test_tensorflow_patch.py 文件源码

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

项目:nengo_dl 作者: nengo 项目源码 文件源码
def test_dynamic_stitch():
    x = tf.zeros((1, 3))
    y = tf.dynamic_stitch([[0], [0]], [x, tf.ones((1, 3))])
    z = tf.gather(y, [0])

    with tf.Session():
        analytic, numeric = tf.test.compute_gradient(x, (1, 3), z, (1, 3))

        assert np.allclose(analytic, numeric)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号