From a983e4699082a0b1ef685bab7354f2ad9cd37a44 Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Wed, 20 May 2020 16:12:19 +0100 Subject: Updating Doxygen documentation for 20.05 release. Change-Id: I4d624343ed5fd6ae269c3d53532903084508fd14 Signed-off-by: Colm Donelan --- 20.05/_load_model_8cpp.xhtml | 344 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 20.05/_load_model_8cpp.xhtml (limited to '20.05/_load_model_8cpp.xhtml') diff --git a/20.05/_load_model_8cpp.xhtml b/20.05/_load_model_8cpp.xhtml new file mode 100644 index 0000000000..a7219cb1dc --- /dev/null +++ b/20.05/_load_model_8cpp.xhtml @@ -0,0 +1,344 @@ + + + + + + + + + + + + + +ArmNN: src/armnnTfLiteParser/test/LoadModel.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
LoadModel.cpp File Reference
+
+
+
#include <boost/test/unit_test.hpp>
+#include "ParserFlatbuffersFixture.hpp"
+#include "../TfLiteParser.hpp"
+
+

Go to the source code of this file.

+ + + + + + + + +

+Typedefs

using ModelPtr = TfLiteParser::ModelPtr
 
using SubgraphPtr = TfLiteParser::SubgraphPtr
 
using OperatorPtr = TfLiteParser::OperatorPtr
 
+ + + + + + + + + + + + + +

+Functions

 BOOST_FIXTURE_TEST_CASE (LoadModelFromBinary, LoadModelFixture)
 
 BOOST_FIXTURE_TEST_CASE (LoadModelFromFile, LoadModelFixture)
 
 BOOST_AUTO_TEST_CASE (LoadNullBinary)
 
 BOOST_AUTO_TEST_CASE (LoadInvalidBinary)
 
 BOOST_AUTO_TEST_CASE (LoadFileNotFound)
 
 BOOST_AUTO_TEST_CASE (LoadNullPtrFile)
 
+

Typedef Documentation

+ +

◆ ModelPtr

+ +
+
+ + + + +
using ModelPtr = TfLiteParser::ModelPtr
+
+ +

Definition at line 10 of file LoadModel.cpp.

+ +
+
+ +

◆ OperatorPtr

+ +
+
+ + + + +
using OperatorPtr = TfLiteParser::OperatorPtr
+
+ +

Definition at line 12 of file LoadModel.cpp.

+ +
+
+ +

◆ SubgraphPtr

+ +
+
+ + + + +
using SubgraphPtr = TfLiteParser::SubgraphPtr
+
+ +

Definition at line 11 of file LoadModel.cpp.

+ +
+
+

Function Documentation

+ +

◆ BOOST_AUTO_TEST_CASE() [1/4]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (LoadNullBinary )
+
+ +

Definition at line 218 of file LoadModel.cpp.

+
219 {
220  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromBinary(nullptr, 0), armnn::InvalidArgumentException);
221 }
+
+
+
+ +

◆ BOOST_AUTO_TEST_CASE() [2/4]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (LoadInvalidBinary )
+
+ +

Definition at line 223 of file LoadModel.cpp.

+
224 {
225  std::string testData = "invalid data";
226  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromBinary(reinterpret_cast<const uint8_t*>(&testData),
227  testData.length()), armnn::ParseException);
228 }
+
+
+
+ +

◆ BOOST_AUTO_TEST_CASE() [3/4]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (LoadFileNotFound )
+
+ +

Definition at line 230 of file LoadModel.cpp.

+
231 {
232  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromFile("invalidfile.tflite"), armnn::FileNotFoundException);
233 }
+
+
+
+ +

◆ BOOST_AUTO_TEST_CASE() [4/4]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (LoadNullPtrFile )
+
+ +

Definition at line 235 of file LoadModel.cpp.

+ +

References BOOST_AUTO_TEST_SUITE_END().

+
236 {
237  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromFile(nullptr), armnn::InvalidArgumentException);
238 }
+
+
+
+ +

◆ BOOST_FIXTURE_TEST_CASE() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
BOOST_FIXTURE_TEST_CASE (LoadModelFromBinary ,
LoadModelFixture  
)
+
+ +

Definition at line 184 of file LoadModel.cpp.

+
185 {
186  TfLiteParser::ModelPtr model = TfLiteParser::LoadModelFromBinary(m_GraphBinary.data(), m_GraphBinary.size());
187  CheckModel(model, 3, 2, { tflite::BuiltinOperator_AVERAGE_POOL_2D, tflite::BuiltinOperator_CONV_2D },
188  2, "Test loading a model", 2);
189  CheckSubgraph(model->subgraphs[0], 2, { 1 }, { 0 }, 1, "");
190  CheckSubgraph(model->subgraphs[1], 3, { 0 }, { 1 }, 1, "");
191  CheckOperator(model->subgraphs[0]->operators[0], 0, { 1 }, { 0 }, tflite::BuiltinOptions_Pool2DOptions,
192  tflite::CustomOptionsFormat_FLEXBUFFERS);
193  CheckOperator(model->subgraphs[1]->operators[0], 1, { 0, 2 }, { 1 }, tflite::BuiltinOptions_Conv2DOptions,
194  tflite::CustomOptionsFormat_FLEXBUFFERS);
195 }
TfLiteParser::ModelPtr ModelPtr
Definition: LoadModel.cpp:10
+
+
+
+ +

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
BOOST_FIXTURE_TEST_CASE (LoadModelFromFile ,
LoadModelFixture  
)
+
+ +

Definition at line 197 of file LoadModel.cpp.

+
198 {
199  using namespace boost::filesystem;
200  std::string fname = unique_path(temp_directory_path() / "%%%%-%%%%-%%%%.tflite").string();
201  bool saved = flatbuffers::SaveFile(fname.c_str(),
202  reinterpret_cast<char *>(m_GraphBinary.data()),
203  m_GraphBinary.size(), true);
204  BOOST_CHECK_MESSAGE(saved, "Cannot save test file");
205 
206  TfLiteParser::ModelPtr model = TfLiteParser::LoadModelFromFile(fname.c_str());
207  CheckModel(model, 3, 2, { tflite::BuiltinOperator_AVERAGE_POOL_2D, tflite::BuiltinOperator_CONV_2D },
208  2, "Test loading a model", 2);
209  CheckSubgraph(model->subgraphs[0], 2, { 1 }, { 0 }, 1, "");
210  CheckSubgraph(model->subgraphs[1], 3, { 0 }, { 1 }, 1, "");
211  CheckOperator(model->subgraphs[0]->operators[0], 0, { 1 }, { 0 }, tflite::BuiltinOptions_Pool2DOptions,
212  tflite::CustomOptionsFormat_FLEXBUFFERS);
213  CheckOperator(model->subgraphs[1]->operators[0], 1, { 0, 2 }, { 1 }, tflite::BuiltinOptions_Conv2DOptions,
214  tflite::CustomOptionsFormat_FLEXBUFFERS);
215  remove(fname);
216 }
TfLiteParser::ModelPtr ModelPtr
Definition: LoadModel.cpp:10
+
+
+
+
+
+ + + + -- cgit v1.2.1