MCPcopy Create free account
hub / github.com/alibaba/MNN / countOutputReference

Method countOutputReference

express/module/PipelineModule.cpp:177–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177std::vector<int> PipelineModule::countOutputReference(std::vector<int> outputIndices) {
178 MNN_ASSERT(outputIndices.size() > 0);
179 std::vector<int> countResult(outputIndices.size(), 0);
180
181 for (int i = 0; i < mSubModules.size(); i++) {
182 auto &m = mSubModules[i];
183 auto& theModule = std::get<0>(m);
184 auto name = theModule->name();
185 auto &inputIndices = std::get<1>(m);
186
187 for (int j = 0; j < inputIndices.size(); j++) {
188 int index = inputIndices[j];
189 for (int k = 0; k < countResult.size(); k++) {
190 if (index == outputIndices[k]) {
191 countResult[k]++;
192 }
193 }
194 }
195 }
196 return countResult;
197}
198int PipelineModule::onOptimize(Interpreter::SessionMode stage) {
199 if (stage == Interpreter::Module_Forward_Separate) {
200 if (mSubModules.size() == 1 && std::get<0>(mSubModules[0])->type() == "StaticModule") {

Callers 1

turnQuantizeMethod · 0.80

Calls 2

sizeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected