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

Method replace_var

src/jit/impl/executor_opr.cpp:456–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454 }
455 VarNode* dest_var() { return m_dest_var; }
456 void replace_var(VarNode* src, VarNode* dst) {
457 // Note: do not perform var replacing recursively
458 // when we extract used placeholders from internal graph, we don't
459 // consider placeholder replacement pair (a to b), (b to c) as a
460 // var replacing chain (a to b to c) but as a injective function
461 // from (a, b) to (b, c)
462 // in other cases, each var node would be passed as \p src or
463 // \p dst at most once
464 m_var_map[src] = dst;
465 }
466 void auto_replace_outputs(cg::OperatorNodeBase* opr) {
467 // in JIT internal graph, output size of opr is always 1
468 mgb_assert(opr->usable_output().size() == 1);

Callers 3

update_graphMethod · 0.45
expand_executor_oprFunction · 0.45
MGB_IMPL_OPR_GRADFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected