提交 25208525 编写于 作者: L liuruilong

format files

上级 210e5523
...@@ -270,8 +270,8 @@ void ProgramOptimize::GenerateOps( ...@@ -270,8 +270,8 @@ void ProgramOptimize::GenerateOps(
} }
void ProgramOptimize::GenerateOps( void ProgramOptimize::GenerateOps(
std::vector<std::shared_ptr<framework::OpDesc>> *op_descs, std::vector<std::shared_ptr<framework::OpDesc>> *op_descs, Node *begin_node,
Node *begin_node, bool can_add_split) { bool can_add_split) {
// std::vector<std::shared_ptr<framework::OpDesc>> *op_desc, // std::vector<std::shared_ptr<framework::OpDesc>> *op_desc,
// Node *input_node, Node *current_node, bool adding_thread, int // Node *input_node, Node *current_node, bool adding_thread, int
// thread_num // thread_num
......
...@@ -75,7 +75,8 @@ static size_t ReadBuffer(const char *file_name, uint8_t **out) { ...@@ -75,7 +75,8 @@ static size_t ReadBuffer(const char *file_name, uint8_t **out) {
template <typename Dtype, Precision P> template <typename Dtype, Precision P>
const framework::Program<Dtype, P> Loader<Dtype, P>::Load( const framework::Program<Dtype, P> Loader<Dtype, P>::Load(
const std::string &dirname, bool optimize, bool can_add_split) { const std::string &dirname, bool optimize, bool can_add_split) {
auto program = this->LoadProgram(dirname + "/__model__", optimize, can_add_split); auto program =
this->LoadProgram(dirname + "/__model__", optimize, can_add_split);
program.model_path = dirname; program.model_path = dirname;
return program; return program;
} }
......
...@@ -35,7 +35,8 @@ class Loader { ...@@ -35,7 +35,8 @@ class Loader {
* @b 加载分开形式的 fluid 模型 * @b 加载分开形式的 fluid 模型
* */ * */
const framework::Program<Dtype, P> Load(const std::string &dirname, const framework::Program<Dtype, P> Load(const std::string &dirname,
bool optimize = false, bool can_add_split = false); bool optimize = false,
bool can_add_split = false);
/* /*
* @b load combine format fluid mode * @b load combine format fluid mode
...@@ -47,7 +48,8 @@ class Loader { ...@@ -47,7 +48,8 @@ class Loader {
private: private:
const framework::Program<Dtype, P> LoadProgram(const std::string &model_path, const framework::Program<Dtype, P> LoadProgram(const std::string &model_path,
bool optimize = false, bool can_add_split = false); bool optimize = false,
bool can_add_split = false);
}; };
template <typename Dtype = CPU, Precision P = Precision::FP32> template <typename Dtype = CPU, Precision P = Precision::FP32>
......
...@@ -12,15 +12,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,15 +12,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "io/io.h"
#include "../test_helper.h" #include "../test_helper.h"
#include "io/io.h"
int main() { int main() {
paddle_mobile::Loader<paddle_mobile::CPU> loader; paddle_mobile::Loader<paddle_mobile::CPU> loader;
// ../../../test/models/googlenet // ../../../test/models/googlenet
// ../../../test/models/mobilenet // ../../../test/models/mobilenet
auto program = loader.Load(g_googlenet, true, true); auto program = loader.Load(g_googlenet, true, true);
// loader.Load(g_googlenet_combine + "/model", g_googlenet_combine + "/params", // loader.Load(g_googlenet_combine + "/model", g_googlenet_combine +
// "/params",
// true); // true);
program.originProgram->Description("program desc: "); program.originProgram->Description("program desc: ");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册