From 91afa0d877bd28535c62a361a947b669cf16ed09 Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Mon, 18 Sep 2017 13:45:24 +0800 Subject: [PATCH] Some bug fix. --- paddle/operators/conv2d_op.cc | 12 +++++++----- paddle/operators/conv2d_op.cu | 4 ++-- paddle/operators/gemm_conv2d_op.h | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/paddle/operators/conv2d_op.cc b/paddle/operators/conv2d_op.cc index b74b42546db..3aedab49920 100644 --- a/paddle/operators/conv2d_op.cc +++ b/paddle/operators/conv2d_op.cc @@ -30,7 +30,7 @@ class Conv2DOp : public framework::OperatorWithKernel { void InferShape(const framework::InferShapeContext &ctx) const override { auto in = ctx.Input("Input"); auto filter = ctx.Input("Filter"); - auto out = ctx.Output("Output"); + auto out = ctx.Output("Output"); std::vector strides = Attr>("strides"); std::vector paddings = Attr>("paddings"); int groups = Attr("groups"); @@ -102,8 +102,10 @@ class Conv2DOpGrad : public framework::OperatorWithKernel { void InferShape(const framework::InferShapeContext &ctx) const override { auto in = ctx.Input("Input"); auto filter = ctx.Input("Filter"); - auto d_in = ctx.Output(framework::GradVarName("Input")); - auto d_filter = ctx.Output(framework::GradVarName("Filter")); + auto d_in = + ctx.Output(framework::GradVarName("Input")); + auto d_filter = + ctx.Output(framework::GradVarName("Filter")); d_in->Resize(in->dims()); d_filter->Resize(filter->dims()); } @@ -117,6 +119,6 @@ REGISTER_OP(conv2d, ops::Conv2DOp, ops::Conv2DOpMaker, conv2d_grad, ops::Conv2DOpGrad); REGISTER_OP_CPU_KERNEL( - conv2d, ops::GemmConv2dKernel); + conv2d, ops::GemmConv2DKernel); REGISTER_OP_CPU_KERNEL( - conv2d_grad, ops::GemmConvGrad2dKernel); + conv2d_grad, ops::GemmConvGrad2DKernel); diff --git a/paddle/operators/conv2d_op.cu b/paddle/operators/conv2d_op.cu index 7666f4c4c12..5df818ba049 100644 --- a/paddle/operators/conv2d_op.cu +++ b/paddle/operators/conv2d_op.cu @@ -17,6 +17,6 @@ namespace ops = paddle::operators; REGISTER_OP_GPU_KERNEL( - conv2d, ops::GemmConv2dKernel); + conv2d, ops::GemmConv2DKernel); REGISTER_OP_GPU_KERNEL( - conv2d_grad, ops::GemmConvGrad2dKernel); + conv2d_grad, ops::GemmConvGrad2DKernel); diff --git a/paddle/operators/gemm_conv2d_op.h b/paddle/operators/gemm_conv2d_op.h index 71bf09bb7e7..a4df7b9cb9e 100644 --- a/paddle/operators/gemm_conv2d_op.h +++ b/paddle/operators/gemm_conv2d_op.h @@ -25,7 +25,7 @@ namespace operators { using Tensor = framework::Tensor; template -class GemmConv2dKernel : public framework::OpKernel { +class GemmConv2DKernel : public framework::OpKernel { public: void Compute(const framework::ExecutionContext& context) const override { const Tensor* input = context.Input("Input"); @@ -101,7 +101,7 @@ class GemmConv2dKernel : public framework::OpKernel { }; template -class GemmConvGrad2dKernel : public framework::OpKernel { +class GemmConvGrad2DKernel : public framework::OpKernel { public: void Compute(const framework::ExecutionContext& context) const override { const Tensor* input = context.Input("Input"); -- GitLab