| 174 | } |
| 175 | |
| 176 | void LoadTensorsMap(const Model& model, TensorsMap* tensors_map) { |
| 177 | // First find a list of unique array names. |
| 178 | std::set<string> names; |
| 179 | for (const auto& array_pair : model.GetArrayMap()) { |
| 180 | names.insert(array_pair.first); |
| 181 | } |
| 182 | |
| 183 | // Now assign indices to them and fill in the map. |
| 184 | int index = 0; |
| 185 | for (const auto& name : names) { |
| 186 | (*tensors_map)[name] = index; |
| 187 | ++index; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | void LoadOperatorsMap( |
| 192 | const Model& model, OperatorsMap* operators_map, |