提交 4fc3c1b2 authored 作者: Frederic Bastien's avatar Frederic Bastien

The real fix to the missing var.

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