| 87 | using namespace MNN; |
| 88 | |
| 89 | static void _zeroInputs(const Interpreter* net, const Session* session) { |
| 90 | // Set Other Inputs to Zero |
| 91 | auto allInput = net->getSessionInputAll(session); |
| 92 | for (auto& iter : allInput) { |
| 93 | auto inputTensor = iter.second; |
| 94 | auto size = inputTensor->size(); |
| 95 | if (size <= 0) { |
| 96 | continue; |
| 97 | } |
| 98 | MNN::Tensor tempTensor(inputTensor, inputTensor->getDimensionType()); |
| 99 | ::memset(tempTensor.host<void>(), 0, tempTensor.size()); |
| 100 | inputTensor->copyFromHostTensor(&tempTensor); |
| 101 | } |
| 102 | } |
| 103 | static void compareForwadType(OUTPUTCONFIG outputNames, Interpreter* net, MNNForwardType expectType, MNNForwardType compareType, float tolerance, |
| 104 | const std::map<std::string, std::shared_ptr<Tensor>>& inputs, const std::string& stopOp, BackendConfig::PrecisionMode precision, int modeNum) { |
| 105 | auto inputNames = _getAllInputs(MNN::GetNet(net->getModelBuffer().first)); |
no test coverage detected