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

Function CountOpsWithInput

tensorflow/lite/toco/tooling_util.cc:142–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142int CountOpsWithInput(const Model& model, const string& array_name) {
143 int count = 0;
144 for (const auto& op : model.operators) {
145 for (auto& input : op->inputs) {
146 if (input == array_name) {
147 count++;
148 // Breaking here is important: some graphs have ops that use the
149 // same array as more than one of their inputs, and in that case
150 // we want it counted only once.
151 break;
152 }
153 }
154 }
155 return count;
156}
157
158bool DeleteArrayIfUnused(const string& array_name, Model* model) {
159 if (IsDiscardableArray(*model, array_name) &&

Callers 15

DeleteArrayIfUnusedFunction · 0.85
UndoWeightsShufflingFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
IsReshapeTrivialFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected