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

rename CxxPredictor

test=develop
上级 b798c9b9
......@@ -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_);
}
......
......@@ -28,14 +28,13 @@ namespace lite {
struct Config {};
class LightPredictor {
class CXXPredictor {
public:
LightPredictor() { scope_ = std::make_shared<Scope>(); }
CXXPredictor() { scope_ = std::make_shared<Scope>(); }
void Build(const std::string& model_path, const Place& prefer_place,
const std::vector<Place>& valid_places) {
LoadModel(model_path, scope_.get(), &program_desc_);
Program program(program_desc_, scope_, valid_places);
optimizer_.KernelPickPreferPlace(prefer_place);
......
......@@ -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<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}});
#else
......
......@@ -26,7 +26,7 @@ namespace paddle {
namespace lite {
TEST(CXXApi, test) {
lite::LightPredictor predictor;
lite::CXXPredictor predictor;
#ifndef LITE_WITH_CUDA
std::vector<Place> 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<Place> valid_places({Place{TARGET(kHost), PRECISION(kFloat)}});
predictor.Build(FLAGS_model_dir, Place{TARGET(kCUDA), PRECISION(kFloat)},
valid_places);
......
......@@ -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(); }
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册