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

Method make_from_op_node

imperative/src/impl/op_def.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace imperative {
12
13std::shared_ptr<OpDef> OpDef::make_from_op_node(cg::OperatorNodeBase* node) {
14 OpTrait* trait;
15 trait = OpTrait::find_by_typeinfo(node->dyn_typeinfo());
16 if (!trait) {
17 // TODO: register `make_from_op_node` for each OperatorNode
18 // instead of forwarding to OprAttr
19 trait = OpTrait::find_by_typeinfo(OprAttr::typeinfo());
20 }
21 mgb_assert(trait);
22 return trait->make_from_op_node(node);
23}
24
25DispatchMode OpDef::decide_dispatch_mode(
26 const OpDef& def, const SmallVector<LogicalTensorDesc>& inputs) {

Callers 11

opr_attr.cppFile · 0.80
broadcast.cppFile · 0.80
convolution.cppFile · 0.80
softmax.cppFile · 0.80
reduce.cppFile · 0.80
elemwise.cppFile · 0.80
tensor_manip.cppFile · 0.80
batch_norm.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected