提交 1e4568e9 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Don't give up moving to gpu after a single failed attempt.

上级 6acf4e67
...@@ -127,13 +127,13 @@ class InputToGpuOptimizer(Optimizer): ...@@ -127,13 +127,13 @@ class InputToGpuOptimizer(Optimizer):
def apply(self, fgraph): def apply(self, fgraph):
for input in fgraph.inputs: for input in fgraph.inputs:
if isinstance(input.type, CudaNdarrayType): if isinstance(input.type, CudaNdarrayType):
return continue
# This happen frequently as we do 2 pass of the gpu optimizations # This happen frequently as we do 2 pass of the gpu optimizations
if (len(input.clients) == 1 and if (len(input.clients) == 1 and
(input.clients[0][0] == 'output' or (input.clients[0][0] == 'output' or
input.clients[0][0].op == gpu_from_host)): input.clients[0][0].op == gpu_from_host)):
return continue
try: try:
new_input = host_from_gpu(gpu_from_host(input)) new_input = host_from_gpu(gpu_from_host(input))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论