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

Function initPipelineInfosFromOps

source/utils/InitNet.cpp:245–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 return valid;
244}
245void initPipelineInfosFromOps(std::vector<Schedule::OpCacheInfo>& infos, std::vector<const Op*>& ops, const std::vector<std::shared_ptr<Tensor>>& allTensors) {
246 for (const Op* op : ops) {
247 // MNN_PRINT("initPipelineInfosFromOps, op type:%s, op name:%s\n", EnumNameOpType(op->type()), op->name()->c_str());
248
249 Schedule::OpCacheInfo opInfo;
250 opInfo.op = op;
251 if (nullptr != op->outputIndexes()) {
252 auto data = op->outputIndexes()->data();
253 for (int j = 0; j < op->outputIndexes()->size(); ++j) {
254 opInfo.outputs.push_back(allTensors[data[j]].get());
255 }
256 }
257 if (nullptr != op->inputIndexes()) {
258 auto data = op->inputIndexes()->data();
259 for (int j = 0; j < op->inputIndexes()->size(); ++j) {
260 opInfo.inputs.push_back(allTensors[data[j]].get());
261 }
262 }
263 if (needComputeOp(op)) {
264 infos.emplace_back(std::move(opInfo));
265 }
266 }
267}
268
269void setInputOutputForOps(std::vector<std::shared_ptr<Tensor>>& allTensors, const std::vector<const Op*>& ops, bool isStatic) {
270 std::set<int> inputIndexes;

Callers 4

_getConstDataFunction · 0.85
converToStaticModelFunction · 0.85
_scheduleUnitFunction · 0.85
_createSubModuleFunction · 0.85

Calls 5

needComputeOpFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected