提交 aadaab78 authored 作者: Frederic's avatar Frederic

Compile the inner fct in scan only once per instance.

上级 05186700
...@@ -566,6 +566,9 @@ class Scan(PureOp): ...@@ -566,6 +566,9 @@ class Scan(PureOp):
profile = ScanProfileStats(name=self.name) profile = ScanProfileStats(name=self.name)
elif self.profile: elif self.profile:
profile = self.profile profile = self.profile
# make_thunk can be called many times on the same op
# we do not want to recompile the inner fct every time.
if not getattr(self, 'fn', None):
self.fn = function(wrapped_inputs, self.fn = function(wrapped_inputs,
wrapped_outputs, wrapped_outputs,
mode=self.mode_instance, mode=self.mode_instance,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论