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

removed refrences to cuda from scan_utils

上级 b8aeac34
...@@ -22,7 +22,6 @@ from theano import gof ...@@ -22,7 +22,6 @@ from theano import gof
from theano import tensor, scalar from theano import tensor, scalar
from theano.tensor.basic import get_constant_value from theano.tensor.basic import get_constant_value
from theano.sandbox import cuda
import theano import theano
...@@ -93,14 +92,11 @@ def traverse(out, x,x_copy, d): ...@@ -93,14 +92,11 @@ def traverse(out, x,x_copy, d):
fine for the main computational graph but confuses things a bit for the fine for the main computational graph but confuses things a bit for the
inner graph of scan ''' inner graph of scan '''
if out == x: if out == x:
d[out] = cuda.gpu_from_host(x_copy) d[out] = tensor.as_tensor_variable(x_copy)
return d return d
elif out.owner is None: elif out.owner is None:
return d return d
elif (out.owner.op == cuda.host_from_gpu
and out.owner.inputs == [x] ):
d[out] = x_copy
return d
else: else:
for inp in out.owner.inputs: for inp in out.owner.inputs:
d = traverse(inp, x, x_copy, d) d = traverse(inp, x, x_copy, d)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论