From c218961a6b9d8603e881fde0bc87e2cf058d5c7a Mon Sep 17 00:00:00 2001 From: sweetsky0901 Date: Sun, 26 Nov 2017 21:22:33 +0800 Subject: [PATCH] modify for code review by qingqing --- paddle/operators/math/unpooling.cc | 4 ++-- paddle/operators/math/unpooling.cu | 4 ++-- paddle/operators/math/unpooling.h | 6 ++---- paddle/operators/unpool_op.cc | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/paddle/operators/math/unpooling.cc b/paddle/operators/math/unpooling.cc index a3a24a68929..d8647c6b236 100644 --- a/paddle/operators/math/unpooling.cc +++ b/paddle/operators/math/unpooling.cc @@ -60,9 +60,9 @@ public: void operator()(const platform::DeviceContext& context, const framework::Tensor& input, const framework::Tensor& indices, - framework::Tensor * input_grad, const framework::Tensor& output, - const framework::Tensor& output_grad) { + const framework::Tensor& output_grad, + framework::Tensor * input_grad) { const int batch_size = input.dims()[0]; const int input_height = input.dims()[2]; const int input_width = input.dims()[3]; diff --git a/paddle/operators/math/unpooling.cu b/paddle/operators/math/unpooling.cu index 358847b315c..d3eaa48547e 100644 --- a/paddle/operators/math/unpooling.cu +++ b/paddle/operators/math/unpooling.cu @@ -114,9 +114,9 @@ class Unpool2dMaxGradFunctor { void operator()(const platform::DeviceContext& context, const framework::Tensor& input, const framework::Tensor& indices, - framework::Tensor * input_grad, const framework::Tensor& output, - const framework::Tensor& output_grad) { + const framework::Tensor& output_grad, + framework::Tensor * input_grad) { const int batch_size = input.dims()[0]; const int input_height = input.dims()[2]; const int input_width = input.dims()[3]; diff --git a/paddle/operators/math/unpooling.h b/paddle/operators/math/unpooling.h index 88e88ba117d..bf79354ed92 100644 --- a/paddle/operators/math/unpooling.h +++ b/paddle/operators/math/unpooling.h @@ -14,8 +14,6 @@ limitations under the License. */ #pragma once #include "paddle/framework/tensor.h" -#include "paddle/platform/device_context.h" -#include "paddle/platform/hostdevice.h" namespace paddle { namespace operators { @@ -37,9 +35,9 @@ class Unpool2dMaxGradFunctor { void operator()(const platform::DeviceContext& context, const framework::Tensor& input, const framework::Tensor& indices, - framework::Tensor * input_grad, const framework::Tensor& output, - const framework::Tensor& output_grad); + const framework::Tensor& output_grad, + framework::Tensor * input_grad); }; } // namespace math } // namespace operators diff --git a/paddle/operators/unpool_op.cc b/paddle/operators/unpool_op.cc index b5f3d56e960..ada9ce8ce5d 100644 --- a/paddle/operators/unpool_op.cc +++ b/paddle/operators/unpool_op.cc @@ -78,7 +78,7 @@ class UnpoolOp : public framework::OperatorWithKernel { auto in_x_dims = ctx->GetInputDim("X"); auto in_y_dims = ctx->GetInputDim("Y"); - std::string unpoolingtype = + std::string unpooling_type = ctx->Attrs().Get("unpoolingtype"); std::vector ksize = ctx->Attrs().Get>("ksize"); std::vector strides = ctx->Attrs().Get>("strides"); -- GitLab