| 243 | return valid; |
| 244 | } |
| 245 | void 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 | |
| 269 | void setInputOutputForOps(std::vector<std::shared_ptr<Tensor>>& allTensors, const std::vector<const Op*>& ops, bool isStatic) { |
| 270 | std::set<int> inputIndexes; |
no test coverage detected