提交 22a9c43f authored 作者: Dustin Webb's avatar Dustin Webb

Made default name functionality more robust to the existane of modules.

上级 42253880
......@@ -161,7 +161,10 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
"""
if name == None:
call_info = tb.extract_stack()[0]
for elem in tb.extract_stack():
if elem[2] != '<module>':
call_info = elem
break
name = call_info[0] + ':' + str(call_info[1])
if updates is None:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论