提交 603d0941 编写于 作者: M Megvii Engine Team

fix(lite): fix layout transform bug in lar for testcase model

GitOrigin-RevId: c97b1c876b0ab2a6d9e4e90ef08fe051b4eff722
上级 51397bfc
......@@ -59,7 +59,9 @@ void TestcaseOption::config_model(
if (model_ptr->get_testcase_num() && !FLAGS_c_opr_lib_with_param) {
if (runtime_param.stage == RunStage::AFTER_MODEL_LOAD) {
auto input_tensor = model_ptr->get_test_input();
auto loader = model_ptr->reset_loader();
auto input_file = model_ptr->get_loader()->reset_file();
auto current_offset = input_file->tell();
auto loader = model_ptr->reset_loader(std::move(input_file));
auto testcase = loader->load(model_ptr->get_mdl_config(), false);
mgb_assert(testcase.output_var_list.size() == input_tensor.size());
for (size_t i = 0; i < input_tensor.size(); ++i) {
......@@ -71,6 +73,10 @@ void TestcaseOption::config_model(
input_tensor[i].second->copy_from(
mgb::HostTensorND::make_proxy(*opr.dev_data()));
}
input_file = model_ptr->get_loader()->reset_file();
input_file->rewind();
input_file->skip(current_offset);
model_ptr->reset_loader(std::move(input_file));
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册