提交 72fb4adb 编写于 作者: S superjomn

rename CxxPredictor

test=develop
上级 b798c9b9
...@@ -25,7 +25,7 @@ namespace paddle { ...@@ -25,7 +25,7 @@ namespace paddle {
namespace lite { namespace lite {
#ifndef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK #ifndef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
void LightPredictor::SaveModel(const std::string &dir) { void CXXPredictor::SaveModel(const std::string &dir) {
MkDirRecursively(dir.c_str()); MkDirRecursively(dir.c_str());
program_->PersistModel(dir, program_desc_); program_->PersistModel(dir, program_desc_);
} }
......
...@@ -28,14 +28,13 @@ namespace lite { ...@@ -28,14 +28,13 @@ namespace lite {
struct Config {}; struct Config {};
class LightPredictor { class CXXPredictor {
public: public:
LightPredictor() { scope_ = std::make_shared<Scope>(); } CXXPredictor() { scope_ = std::make_shared<Scope>(); }
void Build(const std::string& model_path, const Place& prefer_place, void Build(const std::string& model_path, const Place& prefer_place,
const std::vector<Place>& valid_places) { const std::vector<Place>& valid_places) {
LoadModel(model_path, scope_.get(), &program_desc_); LoadModel(model_path, scope_.get(), &program_desc_);
Program program(program_desc_, scope_, valid_places); Program program(program_desc_, scope_, valid_places);
optimizer_.KernelPickPreferPlace(prefer_place); optimizer_.KernelPickPreferPlace(prefer_place);
......
...@@ -20,7 +20,7 @@ namespace paddle { ...@@ -20,7 +20,7 @@ namespace paddle {
namespace lite { namespace lite {
void Run(const char* model_dir) { void Run(const char* model_dir) {
lite::LightPredictor predictor; lite::CXXPredictor predictor;
#ifndef LITE_WITH_CUDA #ifndef LITE_WITH_CUDA
std::vector<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}}); std::vector<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}});
#else #else
......
...@@ -26,7 +26,7 @@ namespace paddle { ...@@ -26,7 +26,7 @@ namespace paddle {
namespace lite { namespace lite {
TEST(CXXApi, test) { TEST(CXXApi, test) {
lite::LightPredictor predictor; lite::CXXPredictor predictor;
#ifndef LITE_WITH_CUDA #ifndef LITE_WITH_CUDA
std::vector<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}}); std::vector<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}});
#else #else
...@@ -64,7 +64,7 @@ TEST(CXXApi, test) { ...@@ -64,7 +64,7 @@ TEST(CXXApi, test) {
#ifndef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK #ifndef LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
TEST(CXXApi, save_model) { TEST(CXXApi, save_model) {
lite::LightPredictor predictor; lite::CXXPredictor predictor;
std::vector<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}}); std::vector<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}});
predictor.Build(FLAGS_model_dir, Place{TARGET(kCUDA), PRECISION(kFloat)}, predictor.Build(FLAGS_model_dir, Place{TARGET(kCUDA), PRECISION(kFloat)},
valid_places); valid_places);
......
...@@ -212,7 +212,7 @@ struct ParamType { ...@@ -212,7 +212,7 @@ struct ParamType {
const Type* type; const Type* type;
ParamType() = default; ParamType() = default;
explicit ParamType(const Type* type) : type(type) {} ParamType(const Type* type) : type(type) {} // NOLINT
std::string DebugString() const { return type->name(); } std::string DebugString() const { return type->name(); }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册