提交 f4779cbb authored 作者: Frederic's avatar Frederic

Don't apply InputToGpuOptimizer to input that are already moved to the gpu.

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