ArmNN
 21.08
TfLiteParser.cpp File Reference
#include "ParserFlatbuffersFixture.hpp"
#include <doctest/doctest.h>

Go to the source code of this file.

Functions

 TEST_SUITE ("TensorflowLiteParser")
 

Function Documentation

◆ TEST_SUITE()

TEST_SUITE ( "TensorflowLiteParser"  )

Definition at line 9 of file TfLiteParser.cpp.

References ParserFlatbuffersFixture::SetupSingleInputSingleOutput(), and TEST_CASE_FIXTURE().

10 {
11 TEST_CASE("ParseEmptyBinaryData")
12 {
13  ITfLiteParser::TfLiteParserOptions options;
14  ITfLiteParserPtr m_Parser(ITfLiteParser::Create(armnn::Optional<ITfLiteParser::TfLiteParserOptions>(options)));
15  // Should throw armnn::ParseException: Buffer doesn't conform to the expected Tensorflow Lite flatbuffers format.
16  CHECK_THROWS_AS(m_Parser->CreateNetworkFromBinary({0}), armnn::ParseException);
17 }
18 
19 struct NoInputBindingsFixture : public ParserFlatbuffersFixture
20 {
21  explicit NoInputBindingsFixture()
22  {
23  m_JsonString = R"(
24  {
25  "version": 3,
26  "operator_codes": [ { "builtin_code": "CONV_2D" } ],
27  "subgraphs": [ { } ]
28  }
29  )";
30  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
31  }
32 };
33 
34 TEST_CASE_FIXTURE(NoInputBindingsFixture, "ParseBadInputBindings")
35 {
36  // Should throw armnn::ParseException: No input binding found for subgraph:0 and name:inputTensor.
37  CHECK_THROWS_AS((RunTest<4, armnn::DataType::QAsymmU8>(0, { }, { 0 })), armnn::ParseException);
38 }
39 
40 }
std::unique_ptr< ITfLiteParser, void(*)(ITfLiteParser *parser)> ITfLiteParserPtr
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)