MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / migraphx_load_py

Function migraphx_load_py

src/py/py.cpp:69–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69extern "C" program migraphx_load_py(const std::string& filename)
70{
71 py::scoped_interpreter guard{};
72 py::dict vars = run_file(filename);
73 auto it = std::find_if(vars.begin(), vars.end(), [](const auto& p) {
74 return py::isinstance<migraphx::program>(p.second);
75 });
76 if(it == vars.end())
77 MIGRAPHX_THROW("No program variable found");
78 return it->second.cast<migraphx::program>();
79}
80
81} // namespace MIGRAPHX_INLINE_NS
82} // namespace migraphx

Callers

nothing calls this directly

Calls 4

run_fileFunction · 0.85
find_ifFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected