diff --git a/paddle/operators/reduce_op.cu b/paddle/operators/reduce_op.cu index 2dffea3a3a0f56833e4111a0d80cbbbd666ad31d..595127b858ea8eb41281f92e92c6467e4d90ff1a 100644 --- a/paddle/operators/reduce_op.cu +++ b/paddle/operators/reduce_op.cu @@ -43,4 +43,4 @@ REGISTER_OP_GPU_KERNEL( ops::ReduceKernel); REGISTER_OP_GPU_KERNEL(reduce_min_grad, ops::ReduceGradKernel); \ No newline at end of file + ops::MaxOrMinGradFunctor>); diff --git a/python/paddle/v2/framework/tests/test_reduce_op.py b/python/paddle/v2/framework/tests/test_reduce_op.py index 58951f290259b294e62988dfa7c3d9cc2e0b7e51..70359d60cbe656150877673c63e81eae92d8ab9a 100644 --- a/python/paddle/v2/framework/tests/test_reduce_op.py +++ b/python/paddle/v2/framework/tests/test_reduce_op.py @@ -60,7 +60,7 @@ class TestKeepDimReduce(OpTest): def setUp(self): self.op_type = "reduce_sum" self.inputs = {'X': np.random.random((5, 6, 10)).astype("float32")} - self.attrs = {'dim': -2, 'keep_dim': 1} + self.attrs = {'dim': -2, 'keep_dim': True} self.outputs = { 'Out': self.inputs['X'].sum(axis=self.attrs['dim'], keepdims=True) }