提交 8976c742 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix second error when an error happen during compilation.

上级 c1d3a0d7
......@@ -1796,6 +1796,7 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
if isinstance(mode, (list, tuple)): # "mode comparison" semantics
raise Exception("We do not support the passing of multiple modes")
fn = None
try:
Maker = getattr(mode, 'function_maker', FunctionMaker)
fn = Maker(inputs,
......@@ -1808,7 +1809,7 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
defaults)
finally:
t2 = time.time()
if profile:
if fn and profile:
profile.compile_time += t2 - t1
# TODO: append
profile.nb_nodes = len(fn.maker.fgraph.apply_nodes)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论