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

Compile the inner fct in scan only once per instance.

上级 05186700
......@@ -566,12 +566,15 @@ class Scan(PureOp):
profile = ScanProfileStats(name=self.name)
elif self.profile:
profile = self.profile
self.fn = function(wrapped_inputs,
wrapped_outputs,
mode=self.mode_instance,
name=self.name,
profile=profile,
on_unused_input='ignore')
# 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,
wrapped_outputs,
mode=self.mode_instance,
name=self.name,
profile=profile,
on_unused_input='ignore')
try:
cython_mintaps = numpy.asarray(self.mintaps, dtype='int32')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论