提交 c796ef3b authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: sentient07

Add constant to the mapping and don't add all outputs.

上级 0f6749da
...@@ -257,14 +257,9 @@ class GraphToGPU(Optimizer): ...@@ -257,14 +257,9 @@ class GraphToGPU(Optimizer):
mapping[i] = GpuFromHost(None)(i) mapping[i] = GpuFromHost(None)(i)
else: else:
mapping[i] = i mapping[i] = i
for i in fgraph.variables:
# Iterating through output of all the nodes if isinstance(i, theano.Constant):
for n in fgraph.toposort(): mapping[i] = i
for o in n.outputs:
if isinstance(o.type, tensor.TensorType):
mapping[o] = GpuFromHost(None)(o)
else:
mapping[o] = o
for node in fgraph.toposort(): for node in fgraph.toposort():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论