| 359 | } |
| 360 | |
| 361 | void ArmNNExecutor::SetupInputsAndOutputs() |
| 362 | { |
| 363 | const size_t noOfInputs = m_IOInfo.m_InputNames.size(); |
| 364 | |
| 365 | if (m_Params.m_InputNames.size() != 0 && m_Params.m_InputNames.size() != noOfInputs) |
| 366 | { |
| 367 | LogAndThrow("Number of input names does not match number of inputs"); |
| 368 | } |
| 369 | |
| 370 | const size_t inputFilePaths = m_Params.m_InputTensorDataFilePaths.size(); |
| 371 | const std::vector<std::string>& inputNames = m_Params.m_InputNames.size() != 0 ? |
| 372 | m_Params.m_InputNames : |
| 373 | m_IOInfo.m_InputNames; |
| 374 | size_t noInputSets = 1; |
| 375 | |
| 376 | if (inputFilePaths != 0) |
| 377 | { |
| 378 | if (inputFilePaths % noOfInputs != 0) |
| 379 | { |
| 380 | LogAndThrow("Number of input files: " + std::to_string(inputFilePaths) + |
| 381 | " not compatible with number of inputs: " + std::to_string(noOfInputs)); |
| 382 | } |
| 383 | noInputSets = inputFilePaths / noOfInputs; |
| 384 | if (noInputSets != 1 && m_Params.m_ReuseBuffers) |
| 385 | { |
| 386 | LogAndThrow("Specifying multiple sets of inputs not compatible with ReuseBuffers"); |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | const size_t noOfOutputs = m_IOInfo.m_OutputNames.size(); |
| 391 | const size_t outputFilePaths = m_Params.m_OutputTensorFiles.size(); |
| 392 | size_t noOutputSets = 1; |
| 393 | |
| 394 | if (outputFilePaths != 0) |
| 395 | { |
| 396 | if (outputFilePaths % noOfOutputs != 0) |
| 397 | { |
| 398 | LogAndThrow("Number of output files: " + std::to_string(outputFilePaths) + |
| 399 | ", not compatible with number of outputs: " + std::to_string(noOfOutputs)); |
| 400 | } |
| 401 | noOutputSets = outputFilePaths / noOfOutputs; |
| 402 | |
| 403 | if (noOutputSets != 1 && m_Params.m_ReuseBuffers) |
| 404 | { |
| 405 | LogAndThrow("Specifying multiple sets of outputs not compatible with ReuseBuffers"); |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | if (m_Params.m_InputTensorDataFilePaths.size() > noOfInputs) |
| 410 | { |
| 411 | ARMNN_LOG(info) << "Given network has " << noOfInputs << " input/s. One input-tensor-data file is required " |
| 412 | << "for each input. The user provided " |
| 413 | << m_Params.m_InputTensorDataFilePaths.size() |
| 414 | << " input-tensor-data file/s which will be used to fill the input/s.\n"; |
| 415 | } |
| 416 | |
| 417 | unsigned int inputCount = 0; |
| 418 | for(unsigned int inputSet = 0; inputSet < noInputSets; ++inputSet) |
nothing calls this directly
no test coverage detected