From 85b099b1ff29514180b6d268e0989bc6f483f7c7 Mon Sep 17 00:00:00 2001 From: wangjiawei04 Date: Wed, 18 Mar 2020 15:47:17 +0800 Subject: [PATCH] precommit resource.cpp --- core/predictor/framework/resource.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/predictor/framework/resource.cpp b/core/predictor/framework/resource.cpp index 07010ac8..d3175f81 100644 --- a/core/predictor/framework/resource.cpp +++ b/core/predictor/framework/resource.cpp @@ -144,14 +144,17 @@ int Resource::initialize(const std::string& path, const std::string& file) { return -1; } // init rocksDB or cube instance - if (resource_conf.has_cube_config_file() && resource_conf.has_cube_config_path()) { + if (resource_conf.has_cube_config_file() && + resource_conf.has_cube_config_path()) { LOG(INFO) << "init cube client, path[ " << resource_conf.cube_config_path() - << " ], config file [ " << resource_conf.cube_config_file() << " ]."; - rec::mcube::CubeAPI *cube = rec::mcube::CubeAPI::instance(); - std::string cube_config_fullpath = "./" + resource_conf.cube_config_path() +"/" + resource_conf.cube_config_file(); + << " ], config file [ " << resource_conf.cube_config_file() + << " ]."; + rec::mcube::CubeAPI* cube = rec::mcube::CubeAPI::instance(); + std::string cube_config_fullpath = "./" + resource_conf.cube_config_path() + + "/" + resource_conf.cube_config_file(); this->cube_config_fullpath = cube_config_fullpath; } - + if (db.get() == nullptr) { db = RocksDBWrapper::RocksDBWrapperFactory("kvdb"); } @@ -166,7 +169,7 @@ int Resource::general_model_initialize(const std::string& path, // TODO: add serving dist op detection, if true, add cube instance init. if (this->cube_config_fullpath.size() != 0) { LOG(INFO) << "init cube by config file : " << this->cube_config_fullpath; - rec::mcube::CubeAPI *cube = rec::mcube::CubeAPI::instance(); + rec::mcube::CubeAPI* cube = rec::mcube::CubeAPI::instance(); cube->init(this->cube_config_fullpath.c_str()); } VLOG(2) << "general model path: " << path; @@ -211,13 +214,10 @@ int Resource::general_model_initialize(const std::string& path, for (int i = 0; i < feed_var_num; ++i) { _config->_feed_name[i] = model_config.feed_var(i).name(); _config->_feed_alias_name[i] = model_config.feed_var(i).alias_name(); - VLOG(2) << "feed var[" << i << "]: " - << _config->_feed_name[i]; - VLOG(2) << "feed var[" << i << "]: " - << _config->_feed_alias_name[i]; + VLOG(2) << "feed var[" << i << "]: " << _config->_feed_name[i]; + VLOG(2) << "feed var[" << i << "]: " << _config->_feed_alias_name[i]; _config->_feed_type[i] = model_config.feed_var(i).feed_type(); - VLOG(2) << "feed type[" << i << "]: " - << _config->_feed_type[i]; + VLOG(2) << "feed type[" << i << "]: " << _config->_feed_type[i]; if (model_config.feed_var(i).is_lod_tensor()) { VLOG(2) << "var[" << i << "] is lod tensor"; -- GitLab