提交 955248cc authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix problems with reduction.

上级 3dc03868
...@@ -323,7 +323,8 @@ class GpuCAReduce(HideC, CAReduceDtype): ...@@ -323,7 +323,8 @@ class GpuCAReduce(HideC, CAReduceDtype):
else: else:
raise NotImplementedError() raise NotImplementedError()
return ReductionKernel(pygpu.get_default_context(), odtype, return ReductionKernel(pygpu.get_default_context(), odtype,
self.scalar_op.identity, reduce_expr, redux) self.scalar_op.identity, reduce_expr, redux,
arguments=[make_argument(node.inputs[0], 'a')])
def perform(self, node, inp, out): def perform(self, node, inp, out):
input, = inp input, = inp
...@@ -344,5 +345,5 @@ class GpuCAReduce(HideC, CAReduceDtype): ...@@ -344,5 +345,5 @@ class GpuCAReduce(HideC, CAReduceDtype):
redux) redux)
output[0] = node._cache_reduction_k(input) output[0] = node._cache_reduction_k(input)
else: else:
output[0] = pygpu.array(input, copy=True, output[0] = pygpu.gpuarray.array(input, copy=True,
dtype=node.outputs[0].type.dtype) dtype=node.outputs[0].type.dtype)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论