diff --git a/paddle/function/ConvOp.h b/paddle/function/ConvOp.h index 2cfc0712557e5bd468e82a81dd4d666a109d11e7..92733bc1b76156269fd6c22799c60a1e8af1a492 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 69ab33052dadc45cac4a795eae7fa765c2ea1073..ba446bf92da264fafa1fb47a2c30da9cb13176ce 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.