ArmNN
 24.02
TfLiteParser.cpp File Reference
#include "TfLiteParser.hpp"
#include "armnnTfLiteParser/Version.hpp"
#include "armnn/LstmParams.hpp"
#include <armnn/BackendOptions.hpp>
#include <armnn/Descriptors.hpp>
#include <armnn/Exceptions.hpp>
#include <armnn/Logging.hpp>
#include <armnn/Tensor.hpp>
#include <armnnUtils/TensorUtils.hpp>
#include <armnn/TypesUtils.hpp>
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <armnn/utility/NumericCast.hpp>
#include <armnnUtils/Permute.hpp>
#include <armnnUtils/Filesystem.hpp>
#include <ParserHelper.hpp>
#include <VerificationHelpers.hpp>
#include <schema_generated.h>
#include <flatbuffers/flexbuffers.h>
#include <fmt/format.h>
#include <algorithm>
#include <iostream>
#include <limits>
#include <numeric>
Include dependency graph for TfLiteParser.cpp:

Go to the source code of this file.

Namespaces

 armnnTfLiteParser
 

Macros

#define ARMNN_THROW_PARSE_EXCEPTION(msg)
 
#define CHECK_SUBGRAPH(MODEL, SUBGRAPH_INDEX)   CheckSubgraph(MODEL, SUBGRAPH_INDEX, CHECK_LOCATION())
 
#define CHECK_MODEL(MODEL, SUBGRAPH_INDEX, OPERATOR_INDEX)   CheckModel(MODEL, SUBGRAPH_INDEX, OPERATOR_INDEX, CHECK_LOCATION())
 
#define CHECK_TENSOR(MODEL, SUBGRAPH_INDEX, TENSOR_INDEX)   CheckTensor(MODEL, SUBGRAPH_INDEX, TENSOR_INDEX, CHECK_LOCATION())
 
#define CHECK_TENSOR_PTR(TENSOR_PTR)   CheckTensorPtr(TENSOR_PTR, CHECK_LOCATION())
 
#define CHECK_BUFFER(MODEL, BUFFER_INDEX)   CheckBuffer(MODEL, BUFFER_INDEX, CHECK_LOCATION())
 
#define CHECK_BUFFER_SIZE(BUFFER_PTR, TENSOR_INFO, BUFFER_ID)   CheckBufferSize(BUFFER_PTR, TENSOR_INFO, BUFFER_ID, CHECK_LOCATION())
 
#define CHECK_SUPPORTED_FUSED_ACTIVATION(OPTION, SUBGRAPH_INDEX, OPERATOR_INDEX)
 

Functions

unsigned int ComputeWrappedIndex (int idx, unsigned int numDimsIn)
 

Macro Definition Documentation

◆ ARMNN_THROW_PARSE_EXCEPTION

#define ARMNN_THROW_PARSE_EXCEPTION (   msg)
Value:
{ \
throw armnn::ParseException( static_cast<const std::stringstream&>( std::stringstream() << msg \
<< ": " \
<< CHECK_LOCATION().AsString()).str()); \
}

Definition at line 41 of file TfLiteParser.cpp.

◆ CHECK_BUFFER

#define CHECK_BUFFER (   MODEL,
  BUFFER_INDEX 
)    CheckBuffer(MODEL, BUFFER_INDEX, CHECK_LOCATION())

Definition at line 251 of file TfLiteParser.cpp.

◆ CHECK_BUFFER_SIZE

#define CHECK_BUFFER_SIZE (   BUFFER_PTR,
  TENSOR_INFO,
  BUFFER_ID 
)    CheckBufferSize(BUFFER_PTR, TENSOR_INFO, BUFFER_ID, CHECK_LOCATION())

Definition at line 322 of file TfLiteParser.cpp.

◆ CHECK_MODEL

#define CHECK_MODEL (   MODEL,
  SUBGRAPH_INDEX,
  OPERATOR_INDEX 
)    CheckModel(MODEL, SUBGRAPH_INDEX, OPERATOR_INDEX, CHECK_LOCATION())

Definition at line 182 of file TfLiteParser.cpp.

◆ CHECK_SUBGRAPH

#define CHECK_SUBGRAPH (   MODEL,
  SUBGRAPH_INDEX 
)    CheckSubgraph(MODEL, SUBGRAPH_INDEX, CHECK_LOCATION())

Definition at line 140 of file TfLiteParser.cpp.

◆ CHECK_SUPPORTED_FUSED_ACTIVATION

#define CHECK_SUPPORTED_FUSED_ACTIVATION (   OPTION,
  SUBGRAPH_INDEX,
  OPERATOR_INDEX 
)
Value:
do { \
if (IsActivationSupported(OPTION->fused_activation_function) == false) \
{ \
throw ParseException( \
fmt::format("TfLite parser doesn't support fused activation: " \
"{}/{} in {} subgraph:{} operator:{} at {}", \
OPTION->fused_activation_function, \
tflite::EnumNameActivationFunctionType(\
OPTION->fused_activation_function), \
__func__, \
SUBGRAPH_INDEX, \
OPERATOR_INDEX, \
CHECK_LOCATION().FileLine())); \
} \
} while(false)

Definition at line 343 of file TfLiteParser.cpp.

◆ CHECK_TENSOR

#define CHECK_TENSOR (   MODEL,
  SUBGRAPH_INDEX,
  TENSOR_INDEX 
)    CheckTensor(MODEL, SUBGRAPH_INDEX, TENSOR_INDEX, CHECK_LOCATION())

Definition at line 203 of file TfLiteParser.cpp.

◆ CHECK_TENSOR_PTR

#define CHECK_TENSOR_PTR (   TENSOR_PTR)    CheckTensorPtr(TENSOR_PTR, CHECK_LOCATION())

Definition at line 216 of file TfLiteParser.cpp.

CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::ParseException
Definition: Exceptions.hpp:92