Browse Source

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

GitOrigin-RevId: c97b1c876b
HuaHua404-patch-4
Megvii Engine Team 2 years ago
parent
commit
603d09418e
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      lite/load_and_run/src/options/strategy_options.cpp

+ 7
- 1
lite/load_and_run/src/options/strategy_options.cpp View File

@@ -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));
}
}
}


Loading…
Cancel
Save