提交 c8a275bc authored 作者: Frederic Bastien's avatar Frederic Bastien

Make sure the transfer don't get optimized

上级 c5b94c13
...@@ -188,9 +188,11 @@ def test_transfer_gpu_gpu(): ...@@ -188,9 +188,11 @@ def test_transfer_gpu_gpu():
av = numpy.asarray(rng.rand(5, 4), dtype='float32') av = numpy.asarray(rng.rand(5, 4), dtype='float32')
gv = gpuarray.array(av, context=get_context(test_ctx_name)) gv = gpuarray.array(av, context=get_context(test_ctx_name))
mode = mode_with_gpu.excluding('cut_gpua_host_transfers', 'local_cut_gpua_host_gpua')
f = theano.function([g], GpuToGpu(test_ctx_name)(g)) f = theano.function([g], GpuToGpu(test_ctx_name)(g), mode=mode)
theano.printing.debugprint(f) topo = f.maker.fgraph.toposort()
assert len(topo) == 1
assert isinstance(topo[0].op, GpuToGpu)
fv = f(gv) fv = f(gv)
assert GpuArrayType.values_eq(fv, gv) assert GpuArrayType.values_eq(fv, gv)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论