MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / PyEnv

Method PyEnv

imperative/src/test/helper.cpp:38–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36std::unique_ptr<PyEnv> PyEnv::m_instance = nullptr;
37
38PyEnv::PyEnv() {
39 mgb_assert(!m_instance);
40 auto err = PyImport_AppendInittab(XSTR(MODULE_NAME), &pyinit);
41 mgb_assert(!err);
42 m_interpreter.reset(new py::scoped_interpreter());
43}
44
45PyEnv& PyEnv::instance() {
46 if (!m_instance) {

Callers

nothing calls this directly

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected