| 43 | } |
| 44 | |
| 45 | void MutableOpResolver::AddCustom(const char* name, |
| 46 | const TfLiteRegistration* registration, |
| 47 | int min_version, int max_version) { |
| 48 | for (int version = min_version; version <= max_version; ++version) { |
| 49 | TfLiteRegistration new_registration = *registration; |
| 50 | new_registration.builtin_code = BuiltinOperator_CUSTOM; |
| 51 | new_registration.custom_name = name; |
| 52 | new_registration.version = version; |
| 53 | auto op_key = std::make_pair(name, version); |
| 54 | custom_ops_[op_key] = new_registration; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void MutableOpResolver::AddAll(const MutableOpResolver& other) { |
| 59 | // map::insert does not replace existing elements, and map::insert_or_assign |