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')
评论列表
文章目录