提交 f09f515b authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Fix for speeding up scan

Before, scan used to add another layer of abstraction between constants and the inner function, so even if you would give as a non sequence a constant the inner function will treat it like a normal theano variable stopping certain optimizations to happen.
上级 9f78a32b
......@@ -814,6 +814,8 @@ def scan( fn
## Step 5.6 all shared variables with no update rules
def new_variable( v ):
if isinstance(new_variable, tensor.Constant):
return v.clone()
new_v = safe_new(v)
if getattr(v,'name', None) is not None:
new_v.name = v.name + '_copy'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论