MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ReplaceArrayUsage

Function ReplaceArrayUsage

tensorflow/lite/toco/tooling_util.cc:285–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void ReplaceArrayUsage(Model* model, const string& old_array_name,
286 const string& new_array_name) {
287 for (auto& op_it : model->operators) {
288 Operator* op = op_it.get();
289 for (size_t i = 0; i < op->inputs.size(); ++i) {
290 if (op->inputs[i] == old_array_name) {
291 op->inputs[i] = new_array_name;
292 }
293 }
294 for (size_t i = 0; i < op->outputs.size(); ++i) {
295 if (op->outputs[i] == old_array_name) {
296 op->outputs[i] = new_array_name;
297 }
298 }
299 }
300}
301
302string FormatArraysList(const Model& model, const std::vector<string>& list) {
303 if (list.empty()) {

Callers 1

DedupeConstantArraysFunction · 0.85

Calls 2

getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected