提交 89a3b4f2 authored 作者: Pierre Luc Carrier's avatar Pierre Luc Carrier

Activate add_no_output_from_inplace by default in scan

上级 7dc5cf52
......@@ -118,6 +118,14 @@ class Scan(PureOp):
optimizer=mode_instance.provided_optimizer,
linker=mode_instance.linker.clone(allow_gc=self.allow_gc))
# Now that scan has its mode instance, we activate optimization
# add_no_output_from_inplace in this mode instance. This will prevent
# Scan from producing outputs by means of inplace operations and
# therefore allow it to pre-allocate memory storage for the outputs,
# avoiding needless copies.
self.mode_instance = \
self.mode_instance.including("add_no_output_from_inplace")
if not hasattr(self, 'name') or self.name is None:
self.name = 'scan_fn'
# to have a fair __eq__ comparison later on, we update the info with
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论