From 2ca2fe9cd1252c189e0d48c93c7391d38fa9514b Mon Sep 17 00:00:00 2001 From: liuruilong Date: Wed, 1 Aug 2018 14:52:10 +0800 Subject: [PATCH] format files --- src/io/executor.cpp | 2 +- src/operators/feed_op.h | 2 +- src/operators/kernel/arm/dropout_kernel.cpp | 2 -- src/operators/kernel/dropout_kernel.h | 2 +- src/operators/kernel/im2sequence_kernel.h | 4 +--- src/operators/kernel/mali/fushion_fc_kernel.cpp | 2 -- src/operators/kernel/prelu_kernel.h | 2 +- src/operators/kernel/scale_kernel.h | 2 +- src/operators/kernel/slice_kernel.h | 2 +- src/operators/op_param.h | 8 ++++---- test/framework/test_load.cpp | 10 +++++----- test/test_helper.h | 1 + tools/build.sh | 4 ++-- 13 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/io/executor.cpp b/src/io/executor.cpp index 6b0af3454e..d6434b64aa 100644 --- a/src/io/executor.cpp +++ b/src/io/executor.cpp @@ -420,6 +420,6 @@ std::vector::Ptype> Executor::Predict( template class Executor; template class Executor; -template class Executor; +template class Executor; } // namespace paddle_mobile diff --git a/src/operators/feed_op.h b/src/operators/feed_op.h index 723747874d..e45ad38fd6 100644 --- a/src/operators/feed_op.h +++ b/src/operators/feed_op.h @@ -29,7 +29,7 @@ class FeedOp : public framework::OperatorBase { std::shared_ptr scope) : framework::OperatorBase(type, inputs, outputs, attrs, scope), - param_(inputs, outputs, attrs, *scope) {} + param_(inputs, outputs, attrs, scope.get()) {} void RunImpl() const { param_.Out()->ShareDataWith(*param_.InputX()); } void Init() {} diff --git a/src/operators/kernel/arm/dropout_kernel.cpp b/src/operators/kernel/arm/dropout_kernel.cpp index af16048a1b..db942b018d 100644 --- a/src/operators/kernel/arm/dropout_kernel.cpp +++ b/src/operators/kernel/arm/dropout_kernel.cpp @@ -14,8 +14,6 @@ limitations under the License. */ #ifdef DROPOUT_OP -#pragma once - #include "operators/kernel/dropout_kernel.h" #include diff --git a/src/operators/kernel/dropout_kernel.h b/src/operators/kernel/dropout_kernel.h index 5a37839719..3ef6b9dd62 100644 --- a/src/operators/kernel/dropout_kernel.h +++ b/src/operators/kernel/dropout_kernel.h @@ -17,7 +17,7 @@ limitations under the License. */ #include "framework/operator.h" #include "operators/op_param.h" -#pragma once; +#pragma once namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/im2sequence_kernel.h b/src/operators/kernel/im2sequence_kernel.h index cb592613f7..aa798fd6af 100644 --- a/src/operators/kernel/im2sequence_kernel.h +++ b/src/operators/kernel/im2sequence_kernel.h @@ -20,13 +20,11 @@ limitations under the License. */ #include "operators/math/vol2col.h" #include "operators/op_param.h" -#pragma once; +#pragma once namespace paddle_mobile { namespace operators { -using namespace framework; - template class Im2SequenceKernel : public framework::OpKernelBase { diff --git a/src/operators/kernel/mali/fushion_fc_kernel.cpp b/src/operators/kernel/mali/fushion_fc_kernel.cpp index a76c3c4601..44a7ce2af6 100755 --- a/src/operators/kernel/mali/fushion_fc_kernel.cpp +++ b/src/operators/kernel/mali/fushion_fc_kernel.cpp @@ -14,8 +14,6 @@ limitations under the License. */ #ifdef FUSION_FC_OP -#pragma once - #include "operators/kernel/fusion_fc_kernel.h" namespace paddle_mobile { diff --git a/src/operators/kernel/prelu_kernel.h b/src/operators/kernel/prelu_kernel.h index 9f5dcb23ee..1569617437 100644 --- a/src/operators/kernel/prelu_kernel.h +++ b/src/operators/kernel/prelu_kernel.h @@ -15,7 +15,7 @@ limitations under the License. */ #include "framework/operator.h" #include "operators/op_param.h" -#pragma once; +#pragma once namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/scale_kernel.h b/src/operators/kernel/scale_kernel.h index cc76a4b59b..98ac71d0bb 100644 --- a/src/operators/kernel/scale_kernel.h +++ b/src/operators/kernel/scale_kernel.h @@ -15,7 +15,7 @@ limitations under the License. */ #include "framework/operator.h" #include "operators/op_param.h" -#pragma once; +#pragma once namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/slice_kernel.h b/src/operators/kernel/slice_kernel.h index e308364602..fd3b8dc767 100644 --- a/src/operators/kernel/slice_kernel.h +++ b/src/operators/kernel/slice_kernel.h @@ -15,7 +15,7 @@ limitations under the License. */ #include "framework/operator.h" #include "operators/op_param.h" -#pragma once; +#pragma once namespace paddle_mobile { namespace operators { diff --git a/src/operators/op_param.h b/src/operators/op_param.h index a1c9baad79..dc790ee348 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -651,10 +651,10 @@ class MultiClassNMSParam : public OpParam { class FeedParam : public OpParam { public: FeedParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, Scope const &scope) { - input_x_ = InputXFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - auto var = scope.Var("batch_size"); + const AttributeMap &attrs, Scope *scope) { + input_x_ = InputXFrom(inputs, *scope); + out_ = OutFrom(outputs, *scope); + auto var = scope->Var("batch_size"); batch_size = var->GetValue(); } const Tensor *InputX() const { return input_x_; } diff --git a/test/framework/test_load.cpp b/test/framework/test_load.cpp index bea7d4ba7d..25cad4feaa 100644 --- a/test/framework/test_load.cpp +++ b/test/framework/test_load.cpp @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#include + #include "../test_helper.h" #include "io/loader.h" @@ -20,12 +22,10 @@ int main() { // ../../../test/models/googlenet // ../../../test/models/mobilenet // auto program = loader.Load(g_googlenet, true); + // auto program = loader.Load(g_mobilenet_ssd, true); - auto program = loader.Load(g_mobilenet_ssd, true); - // auto program = loader.Load(g_googlenet_combine + "/model", - // g_googlenet_combine + - // "/params", true); - + auto program = loader.Load(std::string(g_ocr) + "/model", + std::string(g_ocr) + "/params", false); // program.originProgram->Description("program desc: "); return 0; } diff --git a/test/test_helper.h b/test/test_helper.h index 9a5c62c79c..658af447d6 100644 --- a/test/test_helper.h +++ b/test/test_helper.h @@ -24,6 +24,7 @@ limitations under the License. */ #include "framework/ddim.h" #include "framework/tensor.h" +static const char *g_ocr = "../models/ocr"; static const char *g_mobilenet_ssd = "../models/mobilenet+ssd"; static const char *g_mobilenet_ssd_gesture = "../models/mobilenet+ssd_gesture"; static const char *g_squeezenet = "../models/squeezenet"; diff --git a/tools/build.sh b/tools/build.sh index ced18a1807..bf3545ef16 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -40,8 +40,8 @@ build_for_android() { fi if [ -z "$PLATFORM" ]; then -# PLATFORM="arm-v7a" # Users could choose "arm-v8a" platform. - PLATFORM="arm-v8a" + PLATFORM="arm-v7a" # Users could choose "arm-v8a" platform. +# PLATFORM="arm-v8a" fi if [ "${PLATFORM}" = "arm-v7a" ]; then -- GitLab