From 5be56b06e99770dff8fc94ddf44f96c426c3f6a0 Mon Sep 17 00:00:00 2001 From: zhangyang0701 Date: Mon, 4 Mar 2019 15:06:26 +0800 Subject: [PATCH] change function names to avoid ambiguity for FPGA track --- src/framework/executor.cpp | 5 +++-- src/framework/executor.h | 4 ++-- src/io/api_paddle_mobile.cc | 4 ++-- src/io/paddle_mobile.cpp | 9 +++++---- src/io/paddle_mobile.h | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index 637521ea69..45b469a3d9 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -476,7 +476,7 @@ void Executor::FeedData(const std::vector &v) { } template -void Executor::FeedData(const vector &v) { +void Executor::FeedTensorData(const vector &v) { auto input_size = v.size(); auto vars = program_.scope->VarContain("feed"); PADDLE_MOBILE_ENFORCE(input_size == vars.size(), @@ -503,7 +503,8 @@ void Executor::GetResults(std::vector *v) { } template -void Executor::GetResults(std::vector *v) { +void Executor::GetTensorResults( + std::vector *v) { auto output_size = v->size(); PADDLE_MOBILE_ENFORCE(output_size > 0, "Empty output"); auto vars = program_.scope->VarContain("fetch"); diff --git a/src/framework/executor.h b/src/framework/executor.h index ba1a8b1afe..8c3013e2de 100644 --- a/src/framework/executor.h +++ b/src/framework/executor.h @@ -53,10 +53,10 @@ class Executor { void InjectVariable(const Tensor &t, std::string var_name); void FeedData(const Tensor &t); void FeedData(const std::vector &v); - void FeedData(const std::vector &v); + void FeedTensorData(const std::vector &v); void GetResults(std::vector *v); - void GetResults(std::vector *v); + void GetTensorResults(std::vector *v); std::shared_ptr FetchResult(int id = -1); void Predict_From_To(int start = 0, int end = -1); diff --git a/src/io/api_paddle_mobile.cc b/src/io/api_paddle_mobile.cc index e2c2e6ffbf..1baa9044e6 100644 --- a/src/io/api_paddle_mobile.cc +++ b/src/io/api_paddle_mobile.cc @@ -145,7 +145,7 @@ void PaddleMobilePredictor::FeedPaddleTensors( tensors[i].init(typeid(float)); ConvertPaddleTensors(inputs[i], &tensors[i]); } - paddle_mobile_->FeedData(tensors); + paddle_mobile_->FeedTensorData(tensors); } template @@ -154,7 +154,7 @@ void PaddleMobilePredictor::FetchPaddleTensors( auto num = outputs->size(); PADDLE_MOBILE_ENFORCE(num > 0, "0 output pointers is not permitted"); std::vector tensors(num, nullptr); - paddle_mobile_->GetResults(&tensors); + paddle_mobile_->GetTensorResults(&tensors); for (int i = 0; i < num; i++) { ConvertTensors(*tensors[i], &(*outputs)[i]); } diff --git a/src/io/paddle_mobile.cpp b/src/io/paddle_mobile.cpp index 687185e82a..21f0f58b90 100644 --- a/src/io/paddle_mobile.cpp +++ b/src/io/paddle_mobile.cpp @@ -233,9 +233,9 @@ void PaddleMobile::FeedData(const std::vector &v) { }; template -void PaddleMobile::FeedData( +void PaddleMobile::FeedTensorData( const std::vector &v) { - executor_->FeedData(v); + executor_->FeedTensorData(v); }; template @@ -244,8 +244,9 @@ void PaddleMobile::GetResults(std::vector *v) { } template -void PaddleMobile::GetResults(std::vector *v) { - executor_->GetResults(v); +void PaddleMobile::GetTensorResults( + std::vector *v) { + executor_->GetTensorResults(v); } template diff --git a/src/io/paddle_mobile.h b/src/io/paddle_mobile.h index 1aa0efd6be..d0330d9356 100644 --- a/src/io/paddle_mobile.h +++ b/src/io/paddle_mobile.h @@ -91,10 +91,10 @@ class PaddleMobile { void InjectVariable(const framework::Tensor &t, std::string var_name); void FeedData(const framework::Tensor &t); void FeedData(const std::vector &v); - void FeedData(const std::vector &v); + void FeedTensorData(const std::vector &v); void GetResults(std::vector *v); - void GetResults(std::vector *v); + void GetTensorResults(std::vector *v); std::shared_ptr FetchResult(int id = -1); void Predict_From_To(int start = 0, int end = -1); -- GitLab