From c6e010d0ddaab9d00705c1ce890ede9956559c9f Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Fri, 16 Jun 2017 23:06:43 +0800 Subject: [PATCH] Follow comments. --- paddle/function/ConvOp.h | 12 ++---------- paddle/function/FunctionTest.h | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/paddle/function/ConvOp.h b/paddle/function/ConvOp.h index 2cfc07125..92733bc1b 100644 --- a/paddle/function/ConvOp.h +++ b/paddle/function/ConvOp.h @@ -104,19 +104,11 @@ public: protected: size_t getFilterHeight(const TensorShape& filter) const { - if (filter.ndims() == 5) { - return filter[3]; - } else { - return filter[2]; - } + filter[filter.ndims() - 2]; } size_t getFilterWidth(const TensorShape& filter) const { - if (filter.ndims() == 5) { - return filter[4]; - } else { - return filter[3]; - } + filter[filter.ndims() - 1]; } std::vector strides_; diff --git a/paddle/function/FunctionTest.h b/paddle/function/FunctionTest.h index 69ab33052..ba446bf92 100644 --- a/paddle/function/FunctionTest.h +++ b/paddle/function/FunctionTest.h @@ -296,9 +296,9 @@ public: compareOutputs(); } - std::shared_ptr getCpuFunction() const { return function1_; } + std::shared_ptr getFunction1() const { return function1_; } - std::shared_ptr getGpuFunction() const { return function2_; } + std::shared_ptr getFunction2() const { return function2_; } protected: // only init cpu argument, gpu argument copy from cpu argument. -- GitLab