From 72fb4adba1c8577e27ab7b4613534cb33f81e2be Mon Sep 17 00:00:00 2001 From: superjomn Date: Tue, 14 May 2019 20:19:09 +0800 Subject: [PATCH] rename CxxPredictor test=develop --- paddle/fluid/lite/api/cxx_api.cc | 2 +- paddle/fluid/lite/api/cxx_api.h | 5 ++--- paddle/fluid/lite/api/cxx_api_bin.cc | 2 +- paddle/fluid/lite/api/cxx_api_test.cc | 4 ++-- paddle/fluid/lite/core/type_system.h | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/lite/api/cxx_api.cc b/paddle/fluid/lite/api/cxx_api.cc index 07a216b6373..6bf789c35fe 100644 --- a/paddle/fluid/lite/api/cxx_api.cc +++ b/paddle/fluid/lite/api/cxx_api.cc @@ -25,7 +25,7 @@ namespace paddle { namespace lite { #ifndef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK -void LightPredictor::SaveModel(const std::string &dir) { +void CXXPredictor::SaveModel(const std::string &dir) { MkDirRecursively(dir.c_str()); program_->PersistModel(dir, program_desc_); } diff --git a/paddle/fluid/lite/api/cxx_api.h b/paddle/fluid/lite/api/cxx_api.h index d9c0c4a195a..72e1bea6141 100644 --- a/paddle/fluid/lite/api/cxx_api.h +++ b/paddle/fluid/lite/api/cxx_api.h @@ -28,14 +28,13 @@ namespace lite { struct Config {}; -class LightPredictor { +class CXXPredictor { public: - LightPredictor() { scope_ = std::make_shared(); } + CXXPredictor() { scope_ = std::make_shared(); } void Build(const std::string& model_path, const Place& prefer_place, const std::vector& valid_places) { LoadModel(model_path, scope_.get(), &program_desc_); - Program program(program_desc_, scope_, valid_places); optimizer_.KernelPickPreferPlace(prefer_place); diff --git a/paddle/fluid/lite/api/cxx_api_bin.cc b/paddle/fluid/lite/api/cxx_api_bin.cc index 4ff18ded849..4340387f853 100644 --- a/paddle/fluid/lite/api/cxx_api_bin.cc +++ b/paddle/fluid/lite/api/cxx_api_bin.cc @@ -20,7 +20,7 @@ namespace paddle { namespace lite { void Run(const char* model_dir) { - lite::LightPredictor predictor; + lite::CXXPredictor predictor; #ifndef LITE_WITH_CUDA std::vector valid_places({Place{TARGET(kHost), PRECISION(kFloat)}}); #else diff --git a/paddle/fluid/lite/api/cxx_api_test.cc b/paddle/fluid/lite/api/cxx_api_test.cc index 3d929ffb38a..bbd19340a14 100644 --- a/paddle/fluid/lite/api/cxx_api_test.cc +++ b/paddle/fluid/lite/api/cxx_api_test.cc @@ -26,7 +26,7 @@ namespace paddle { namespace lite { TEST(CXXApi, test) { - lite::LightPredictor predictor; + lite::CXXPredictor predictor; #ifndef LITE_WITH_CUDA std::vector valid_places({Place{TARGET(kHost), PRECISION(kFloat)}}); #else @@ -64,7 +64,7 @@ TEST(CXXApi, test) { #ifndef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK TEST(CXXApi, save_model) { - lite::LightPredictor predictor; + lite::CXXPredictor predictor; std::vector valid_places({Place{TARGET(kHost), PRECISION(kFloat)}}); predictor.Build(FLAGS_model_dir, Place{TARGET(kCUDA), PRECISION(kFloat)}, valid_places); diff --git a/paddle/fluid/lite/core/type_system.h b/paddle/fluid/lite/core/type_system.h index b83eca233bf..46d17e3c33e 100644 --- a/paddle/fluid/lite/core/type_system.h +++ b/paddle/fluid/lite/core/type_system.h @@ -212,7 +212,7 @@ struct ParamType { const Type* type; ParamType() = default; - explicit ParamType(const Type* type) : type(type) {} + ParamType(const Type* type) : type(type) {} // NOLINT std::string DebugString() const { return type->name(); } }; -- GitLab