| 11 | namespace imperative { |
| 12 | |
| 13 | std::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 | |
| 25 | DispatchMode OpDef::decide_dispatch_mode( |
| 26 | const OpDef& def, const SmallVector<LogicalTensorDesc>& inputs) { |
no outgoing calls
no test coverage detected