提交 64a907e9 authored 作者: nouiz's avatar nouiz

Merge pull request #528 from pascanur/gpu_specify_shape

Gpu specify shape
差异被折叠。
...@@ -68,6 +68,15 @@ def test_gpualloc(): ...@@ -68,6 +68,15 @@ def test_gpualloc():
assert numpy.any(ininstance(x.op, cuda.GpuAlloc) for x in l ) assert numpy.any(ininstance(x.op, cuda.GpuAlloc) for x in l )
def test_gpuspecifyshape():
x = cuda.shared_constructor(numpy.ones(3,dtype='float32'), 'x')
m = theano.tensor.specify_shape(x + numpy.float32(1), (3,))
f = theano.function([], updates={x:m * numpy.float32(2)},
mode=mode_with_gpu)
l = f.maker.env.toposort()
assert not numpy.any([isinstance(x.op, cuda.HostFromGpu) for x in l])
def test_softmax(): def test_softmax():
x = tensor.fmatrix() x = tensor.fmatrix()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论