MCPcopy Create free account
hub / github.com/ARM-software/armnn / CreateParser

Method CreateParser

tests/ExecuteNetwork/ArmNNExecutor.cpp:647–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645}
646
647std::unique_ptr<ArmNNExecutor::IParser> ArmNNExecutor::CreateParser()
648{
649 const fs::path modelFilename = m_Params.m_ModelPath;
650 const std::string modelExtension = modelFilename.extension();
651
652 m_Params.m_IsModelBinary = modelExtension != ".json";
653 std::unique_ptr<IParser> parser = nullptr;
654 // Forward to implementation based on the parser type
655 if (modelExtension == ".armnn")
656 {
657#if defined(ARMNN_SERIALIZER)
658 parser = std::make_unique<ArmNNDeserializer>();
659#else
660 LogAndThrow("Not built with serialization support.");
661#endif
662 }
663 else if (modelExtension == ".tflite")
664 {
665#if defined(ARMNN_TF_LITE_PARSER)
666 parser = std::make_unique<TfliteParser>(m_Params);
667#else
668 LogAndThrow("Not built with Tensorflow-Lite parser support.");
669#endif
670 }
671 else if (modelExtension == ".onnx")
672 {
673#if defined(ARMNN_ONNX_PARSER)
674 parser = std::make_unique<OnnxParser>();
675#else
676 LogAndThrow("Not built with Onnx parser support.");
677#endif
678 }
679 if (parser == nullptr)
680 {
681 throw InvalidArgumentException("Unable to determine the model type based on the file name extension.");
682 }
683 return parser;
684}
685
686void ArmNNExecutor::PrintOutputTensors(const armnn::OutputTensors* outputTensors,
687 unsigned int iteration)

Callers

nothing calls this directly

Calls 3

LogAndThrowFunction · 0.85
extensionMethod · 0.80

Tested by

no test coverage detected