提交 6101a0ea authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix test following changes from this PR.

上级 a9564d15
...@@ -26,6 +26,7 @@ from ..subtensor import GpuSubtensor ...@@ -26,6 +26,7 @@ from ..subtensor import GpuSubtensor
from .config import mode_with_gpu, mode_without_gpu, test_ctx_name from .config import mode_with_gpu, mode_without_gpu, test_ctx_name
import pygpu
from pygpu import gpuarray from pygpu import gpuarray
utt.seed_rng() utt.seed_rng()
...@@ -234,7 +235,8 @@ def gpu_alloc_expected(x, *shp): ...@@ -234,7 +235,8 @@ def gpu_alloc_expected(x, *shp):
GpuAllocTester = makeTester( GpuAllocTester = makeTester(
name="GpuAllocTester", name="GpuAllocTester",
op=alloc, # The +1 is there to allow the lift to the GPU.
op=lambda *args: alloc(*args)+1,
gpu_op=GpuAlloc(test_ctx_name), gpu_op=GpuAlloc(test_ctx_name),
cases=dict( cases=dict(
correct01=(rand(), np.int32(7)), correct01=(rand(), np.int32(7)),
......
...@@ -25,8 +25,8 @@ GpuGemvTester = makeTester( ...@@ -25,8 +25,8 @@ GpuGemvTester = makeTester(
'GpuGemvTester', 'GpuGemvTester',
op=gemv_inplace, gpu_op=gpugemv_inplace, op=gemv_inplace, gpu_op=gpugemv_inplace,
# It doesn't support float16 # It doesn't support float16
cases=dict(dot_vv=[rand(1), 1, rand(1, 2), rand(2), 0], cases=dict(dot_vv=[rand(1), 1., rand(1, 2), rand(2), 0.],
dot_vm=[rand(3), 1, rand(3, 2), rand(2), 0], dot_vm=[rand(3), 1., rand(3, 2), rand(2), 0.],
float32=[rand(3).astype('float32'), np.float32(1), float32=[rand(3).astype('float32'), np.float32(1),
rand(3, 2).astype('float32'), rand(3, 2).astype('float32'),
rand(2).astype('float32'), np.float32(0)], rand(2).astype('float32'), np.float32(0)],
...@@ -36,7 +36,7 @@ GpuGemvTester = makeTester( ...@@ -36,7 +36,7 @@ GpuGemvTester = makeTester(
# test_02=[rand(0), 1, rand(0, 2), rand(2), 0], # test_02=[rand(0), 1, rand(0, 2), rand(2), 0],
# test_30=[rand(3), 1, rand(3, 0), rand(0), 0], # test_30=[rand(3), 1, rand(3, 0), rand(0), 0],
# test_00=[rand(0), 1, rand(0, 0), rand(0), 0], # test_00=[rand(0), 1, rand(0, 0), rand(0), 0],
test_stride=[rand(3)[::-1], 1, rand(3, 2)[::-1], rand(2)[::-1], 0], test_stride=[rand(3)[::-1], 1., rand(3, 2)[::-1], rand(2)[::-1], 0.],
) )
) )
......
...@@ -510,8 +510,8 @@ def test_not_useless_scalar_gpuelemwise(): ...@@ -510,8 +510,8 @@ def test_not_useless_scalar_gpuelemwise():
train(x) train(x)
topo = train.maker.fgraph.toposort() topo = train.maker.fgraph.toposort()
gemms = [app for app in topo if isinstance(app.op, GpuGemm)] gemms = [app for app in topo if isinstance(app.op, GpuGemm)]
assert len(gemms) == 1 assert len(gemms) == 2
assert isinstance(gemms[0].inputs[1].owner.op, tensor.Elemwise) assert isinstance(gemms[1].inputs[1].owner.op, tensor.Elemwise)
def test_local_lift_abstractconv_gpu_shape(): def test_local_lift_abstractconv_gpu_shape():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论