diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index 637521ea69e6301b6242d492eacc8dcf38091bfb..45b469a3d9ba08e8b07126dd66d722d85a414fee 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 ba1a8b1afef3a9f592c4f84301576f187bc3c001..8c3013e2de2ac9e436256b4675827646337bfd4e 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 e2c2e6ffbfbe140d95d24684eb57227cc9503e78..1baa9044e695ae5eceb777f104a2cebf87f740dd 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 687185e82a44806783535e084cf34e90ca09882d..21f0f58b904c0c926323d3b8196568d7ae49c374 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 1aa0efd6beaadaa461643610023ae10a3543604f..d0330d9356136494c537c2b7166ac682ee598e93 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);