| 49 | } |
| 50 | |
| 51 | Maybe<Operator> CheckAndConstructOp(std::shared_ptr<const OperatorConf> op_conf) { |
| 52 | Operator* rptr = NewObj<int32_t, Operator>(op_conf->op_type_case(), *op_conf); |
| 53 | DeviceType device_type = JUST(DeviceType4DeviceTag(op_conf->device_tag())); |
| 54 | if (IsCpuOnly(*op_conf)) { CHECK_EQ_OR_RETURN(device_type, DeviceType::kCPU); } |
| 55 | JUST(rptr->Init(op_conf)); |
| 56 | return std::shared_ptr<Operator>(rptr); |
| 57 | } |
| 58 | |
| 59 | } // namespace |
| 60 |
no test coverage detected