Preload Mode

In this example, a \ref analysis.py is used

When the application scenario requires preloading mode, initialize it first:

Python

pre_module = bmf.create_module(module_name, option)

C++

nlohmann::json pre_module_option = {
     {"name", "analysis_SR"},
     {"para", "analysis_SR"}
};
auto pre_module = bmf::builder::GetModuleInstance("analysis", pre_module_option.dump());

Then you can use it directly:

Python

bmf. graph()
     .module(module_name, option, pre_module=pre_module)

C++

auto analyzed = output.PythonModule({}, "analysis", bmf_sdk::JsonParam());
analyzed. SetPreModule(pre_module);

If you need the complete code, you can refer to test_pre_module.py (Python) or c_mode.cpp


Last modified February 19, 2024 : fix baidu statistics (daa0758)