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

Function run_file

src/py/py.cpp:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57static py::dict run_file(const std::string& file)
58{
59 py::object scope = py::module_::import("__main__").attr("__dict__");
60 std::string buffer;
61 buffer.append("import sys\n");
62 buffer.append("sys.path.insert(0, '" + python_path() + "')\n");
63 buffer.append("import migraphx\n");
64 buffer.append(read_string(file));
65 py::exec(buffer, scope);
66 return scope.cast<py::dict>();
67}
68
69extern "C" program migraphx_load_py(const std::string& filename)
70{

Callers 1

migraphx_load_pyFunction · 0.85

Calls 3

read_stringFunction · 0.85
execFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected