model.py 文件源码

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

项目:tensorprob 作者: tensorprob 项目源码 文件源码
def _rewrite_graph(self, transform):
        input_map = {k.name: v for k, v in transform.items()}

        # Modify the input dictionary to replace variables which have been
        # superseded with the use of combinators
        for k, v in self._silently_replace.items():
            input_map[k.name] = self._observed[v]

        with self.session.graph.as_default():
            try:
                tf.import_graph_def(
                        self._model_graph.as_graph_def(),
                        input_map=input_map,
                        name='added',
                )
            except ValueError:
                # Ignore errors that ocour when the input_map tries to
                # rewrite a variable that isn't present in the graph
                pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号