| 175 | } |
| 176 | |
| 177 | std::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 | } |
| 198 | int PipelineModule::onOptimize(Interpreter::SessionMode stage) { |
| 199 | if (stage == Interpreter::Module_Forward_Separate) { |
| 200 | if (mSubModules.size() == 1 && std::get<0>(mSubModules[0])->type() == "StaticModule") { |
no test coverage detected