ifnode.inputs[0].ownerandnode.inputs[0].owner.op==host_from_gpu:#if the input was on the gpu
ifnode.inputs[0].ownerand \
node.inputs[0].owner.op==host_from_gpu:
replace=True
ifall([c!='output'andc.op==gpu_from_host
forc,idxinnode.outputs[0].clients]):
# if all clients are on gpu
replace=True
ifall([c!='output'and
c.op==tensor.joinand
all([i.ownerand
i.owner.opin[host_from_gpu,tensor.alloc]
foriinc.inputs[1:]])
forc,idxinnode.outputs[0].clients]):
# if the client is a subtensor with input on gpu or alloc
replace=True
replace=True
ifall([c!='output'andc.op==gpu_from_hostforc,idxinnode.outputs[0].clients]):#if all clients are on gpu
replace=True
ifall([c!='output'andc.op==tensor.joinandall([i.ownerandi.owner.opin[host_from_gpu,tensor.alloc]foriinc.inputs[1:]])forc,idxinnode.outputs[0].clients]):#if the client is a subtensor with input on gpu or alloc
replace=True
ifreplace:
ifreplace:
val=node.inputs[0]
val=node.inputs[0]
shp=node.inputs[1:]
shp=node.inputs[1:]
...
@@ -1155,7 +1297,8 @@ def local_gpualloc(node):
...
@@ -1155,7 +1297,8 @@ def local_gpualloc(node):
assertnew_out.type.dtype==old_out.type.dtype
assertnew_out.type.dtype==old_out.type.dtype
# it seems to have happened that new_out has some broadcastable
# it seems to have happened that new_out has some broadcastable