tf_util.py 文件源码

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

项目:distributional_perspective_on_RL 作者: Kiwoo 项目源码 文件源码
def __init__(self, var_list, dtype=tf.float32):
        assigns = []
        shapes = list(map(var_shape, var_list))
        total_size = np.sum([intprod(shape) for shape in shapes])

        self.theta = theta = tf.placeholder(dtype,[total_size])
        start=0
        assigns = []
        for (shape,v) in zip(shapes,var_list):
            size = intprod(shape)
            assigns.append(tf.assign(v, tf.reshape(theta[start:start+size],shape)))
            start+=size
        self.op = tf.group(*assigns)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号