提交 b2bc4f62 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add way to specify the allow_gc flags on individual scan instances.

上级 17d1e8c4
......@@ -74,7 +74,8 @@ def scan(fn,
go_backwards=False,
mode=None,
name=None,
profile=False):
profile=False,
allow_gc=None):
"""
This function constructs and applies a Scan op to the provided
arguments.
......@@ -309,6 +310,10 @@ def scan(fn,
inner graph with the new cvm linker ( with default modes,
other linkers this argument is useless)
:param allow_gc:
Set the value of allow gc for the internal graph of scan. If
set to None, this will use the value of config.scan.allow_gc.
:rtype: tuple
:return: tuple of the form (outputs, updates); ``outputs`` is either a
Theano variable or a list of Theano variables representing the
......@@ -981,7 +986,7 @@ def scan(fn,
info['as_while'] = as_while
info['profile'] = profile
local_op = scan_op.Scan(inner_inputs, new_outs, info)
local_op = scan_op.Scan(inner_inputs, new_outs, info, allow_gc=allow_gc)
##
### Step 8. Compute the outputs using the scan op
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论