exnviz.py 文件源码

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

项目:ngraph 作者: NervanaSystems 项目源码 文件源码
def add_tensor_decl(self, tensor_decl):
        if tensor_decl in self.tensors_with_nodes:
            return
        if tensor_decl in self.tensors_without_nodes:
            self.tensors_without_nodes.remove(tensor_decl)
        self.tensors_with_nodes.add(tensor_decl)

        views_labels = ' | '.join(['<{}>'.format(self.tensor_view_decl_ext(tensor_view_decl))
                                   for tensor_view_decl in
                                   six.itervalues(tensor_decl.tensor_view_decls)])
        label = '{ <tensor> ' + tensor_decl.name + ' | { ' + views_labels + ' } }'
        self.graph.node(self.tensor_decl_name(tensor_decl), label=label, shape='Mrecord',
                        fillcolor=tensor_color, style='filled')
        if False:
            self.graph.edge(self.tensor_decl_name(tensor_decl), self.exop_name(tensor_decl),
                            color=tensor_edge_color, style='dashed')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号