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

Fixes for gpuarray in DebugMode

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