| 143 | } |
| 144 | |
| 145 | CompTaskNode* NewCompTaskNode4OpNode(const OpNode* op_node) { |
| 146 | const OperatorConf& op_conf = op_node->op().op_conf(); |
| 147 | if (op_conf.has_user_conf()) { |
| 148 | const std::string& op_type_name = op_conf.user_conf().op_type_name(); |
| 149 | if (IsClassRegistered<std::string, OpCompTaskNodeCreator>(op_type_name)) { |
| 150 | return std::unique_ptr<OpCompTaskNodeCreator>( |
| 151 | NewObj<std::string, OpCompTaskNodeCreator>(op_type_name)) |
| 152 | ->NewCompTaskNode(op_conf); |
| 153 | } else { |
| 154 | return new NormalForwardCompTaskNode; |
| 155 | } |
| 156 | } else { |
| 157 | OperatorConf::OpTypeCase op_type_case = op_conf.op_type_case(); |
| 158 | if (IsClassRegistered<int32_t, OpCompTaskNodeCreator>(op_type_case)) { |
| 159 | return std::unique_ptr<OpCompTaskNodeCreator>( |
| 160 | NewObj<int32_t, OpCompTaskNodeCreator>(op_type_case)) |
| 161 | ->NewCompTaskNode(op_conf); |
| 162 | } else { |
| 163 | return new NormalForwardCompTaskNode; |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | } // namespace oneflow |
no test coverage detected