提交 32645f15 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fixes for gpuarray in DebugMode

上级 6328000d
...@@ -996,6 +996,8 @@ class GpuJoin(HideC, Join): ...@@ -996,6 +996,8 @@ class GpuJoin(HideC, Join):
def perform(self, node, axis_and_tensors, out_, ctx): def perform(self, node, axis_and_tensors, out_, ctx):
out, = out_ out, = out_
axis = int(axis_and_tensors[0]) axis = int(axis_and_tensors[0])
if axis < 0:
axis += axis_and_tensors[1].ndim
tensors = axis_and_tensors[1:] tensors = axis_and_tensors[1:]
out[0] = pygpu.concatenate(tensors, axis=axis, context=ctx).astype( out[0] = pygpu.concatenate(tensors, axis=axis, context=ctx).astype(
node.outputs[0].dtype) node.outputs[0].dtype)
......
...@@ -287,7 +287,8 @@ class GpuDot22(BlasOp): ...@@ -287,7 +287,8 @@ class GpuDot22(BlasOp):
def perform(self, node, inputs, outputs): def perform(self, node, inputs, outputs):
x, y = inputs x, y = inputs
out = pygpu.empty((x.shape[0], y.shape[1]), dtype=x.dtype) out = pygpu.empty((x.shape[0], y.shape[1]), dtype=x.dtype,
context=x.context)
outputs[0][0] = blas.gemm(1., x, y, 0., out, outputs[0][0] = blas.gemm(1., x, y, 0., out,
overwrite_c=True) overwrite_c=True)
......
...@@ -462,6 +462,10 @@ class GpuImages2Neibs(GpuKernelBase, Images2Neibs, Op): ...@@ -462,6 +462,10 @@ class GpuImages2Neibs(GpuKernelBase, Images2Neibs, Op):
} // END NESTED SCOPE } // END NESTED SCOPE
""" % locals() """ % locals()
def perform(self, node, inp, out, ctx):
# Disable the perform method from the CPU version
Op.perform(self, node, inp, out, ctx)
@op_lifter([Images2Neibs]) @op_lifter([Images2Neibs])
def use_gpu_images2neibs(node, context_name): def use_gpu_images2neibs(node, context_name):
......
...@@ -3884,11 +3884,7 @@ class T_Join_and_Split(unittest.TestCase): ...@@ -3884,11 +3884,7 @@ class T_Join_and_Split(unittest.TestCase):
got = f(-2) got = f(-2)
assert numpy.allclose(got, want) assert numpy.allclose(got, want)
try: self.assertRaises((IndexError, OverflowError), f, -3)
got = f(-3)
assert False
except IndexError:
pass
def test_join_matrixC_negative_axis(self): def test_join_matrixC_negative_axis(self):
"""constant join negative axis""" """constant join negative axis"""
...@@ -3920,11 +3916,7 @@ class T_Join_and_Split(unittest.TestCase): ...@@ -3920,11 +3916,7 @@ class T_Join_and_Split(unittest.TestCase):
got = f() got = f()
assert numpy.allclose(got, want) assert numpy.allclose(got, want)
try: self.assertRaises((IndexError, OverflowError), join, -3, a, b)
s = join(-3, a, b)
assert False
except IndexError:
pass
utt.verify_grad(lambda a, b: join(-1, a, b), [v, 2 * v], utt.verify_grad(lambda a, b: join(-1, a, b), [v, 2 * v],
mode=self.mode) mode=self.mode)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论