提交 7455d2d7 authored 作者: Razvan Pascanu's avatar Razvan Pascanu 提交者: Razvan Pascanu

Fix the pushout optimization

When running on GPU, and constructing the list of inputs, they might not end up on the right device (i.e. the input is on gpu instead of cpu or the other way around). The simple fix is just to filter the arguments.
上级 560ad497
......@@ -222,6 +222,8 @@ class PushOutNonSeqScan(gof.Optimizer):
'to move some computation fron scan '
'which is not allowed to move. Report '
'this on theano-users list'), x)
outside_ins = [x.type.filter_variable(y) for x,y in
zip(nd.inputs, outside_ins)]
nw_outer_node = nd.op.make_node(*outside_ins)
# Step 2. Create variables for replacements
for idx, y in enumerate(nd.outputs):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论