tf_util.py 文件源码

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

项目:distributional_perspective_on_RL 作者: Kiwoo 项目源码 文件源码
def __call__(self, *args):
        if args in self.cache:
            print("(%s) retrieving value from cache"%self.name)
            return self.cache[args]
        with tf.variable_scope(self.name, reuse=not self.first_time):
            scope = tf.get_variable_scope().name
            if self.first_time:
                self.scope = scope
                print("(%s) running function for the first time"%self.name)
            else:
                assert self.scope == scope, "Tried calling function with a different scope"
                print("(%s) running function on new inputs"%self.name)
            self.first_time = False
            out = self._call(*args)
        self.cache[args] = out
        return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号