提交 21fea7fa authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fixed bug in min_informative_str that causes exception for unhashable

objects
上级 388a827b
......@@ -995,7 +995,7 @@ def min_informative_str(obj, indent_level=0,
indent = ' ' * indent_level
if obj in _prev_obs:
if id(obj) in _prev_obs:
tag = _prev_obs[obj]
return indent + '<' + tag + '>'
......@@ -1005,7 +1005,7 @@ def min_informative_str(obj, indent_level=0,
cur_tag = _tag_generator.get_tag()
_prev_obs[obj] = cur_tag
_prev_obs[id(obj)] = cur_tag
if hasattr(obj, '__array__'):
name = '<ndarray>'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论