提交 732c351a authored 作者: gdesjardins's avatar gdesjardins

small bug fix in printing.pydotprint_variables, fixes a "variables used before

defined" error, probably left over from a bad merge.
上级 6d661d80
......@@ -665,12 +665,13 @@ def pydotprint_variables(vars,
dstr = 'val='+str(var.data)
if '\n' in dstr:
dstr = dstr[:dstr.index('\n')]
if len(dstr) > max_label_size:
dstr = dstr[:max_label_size-1]+'...'
varstr = '%s [%s]'% (dstr, str(var.type))
else:
#a var id is needed as otherwise var with the same type will be merged in the graph.
varstr = str(var.type)
if len(dstr) > max_label_size:
dstr = dstr[:max_label_size-1]+'...'
varstr += ' ' + str(len(var_str))
var_str[var]=varstr
return varstr
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论