| 313 | bool isBreak = false; |
| 314 | }; |
| 315 | static void _computeTensorMask(SubModuleInfo& m, const Net* net) { |
| 316 | /**Compute All SubModule's inputs and outputs*/ |
| 317 | // 0: not use, 1: input, 2: output, 3: mid, 4: valid output |
| 318 | m.tensorMask = std::vector<uint8_t>(net->tensorName()->size(), 0); |
| 319 | auto& tensorMask = m.tensorMask; |
| 320 | for (auto opIndex : m.opList) { |
| 321 | auto op = net->oplists()->GetAs<Op>(opIndex); |
| 322 | if (nullptr != op->inputIndexes()) { |
| 323 | for (int v=0; v<op->inputIndexes()->size(); ++v) { |
| 324 | auto index = op->inputIndexes()->data()[v]; |
| 325 | tensorMask[index] = tensorMask[index] | 1; |
| 326 | } |
| 327 | } |
| 328 | if (nullptr != op->outputIndexes()) { |
| 329 | for (int v=0; v<op->outputIndexes()->size(); ++v) { |
| 330 | auto index = op->outputIndexes()->data()[v]; |
| 331 | tensorMask[index] = tensorMask[index] | 2; |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | static bool isBreakOp(const Op* op) { |
| 338 | bool isWhileControlflow = false; |
no test coverage detected