提交 9d46ac58 authored 作者: Frederic Bastien's avatar Frederic Bastien

made var id shorter

上级 7dca3e80
......@@ -314,6 +314,7 @@ def pydotprint(fct, outfile=os.path.join(config.compiledir,'theano.pydotprint.pn
import pydot as pd
g=pd.Dot()
var_id={}
def var_name(var):
if var.name is not None:
varstr = var.name
......@@ -321,7 +322,11 @@ def pydotprint(fct, outfile=os.path.join(config.compiledir,'theano.pydotprint.pn
varstr = str(var.data)
else:
#a var id is needed as otherwise var with the same type will be merged in the graph.
varstr = str(var.type)+' '+str(id(var))
i = var_id.get(var,None)
if i is None:
var_id[var]=len(var_id)
i = var_id[var]
varstr = str(var.type)+' '+str(i)
return varstr
for node_idx,node in enumerate(fct.maker.env.toposort()):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论