ArmNN
 20.02
TfParser.cpp File Reference
#include "TfParser.hpp"
#include <armnn/TypesUtils.hpp>
#include <armnn/Descriptors.hpp>
#include <armnnUtils/Permute.hpp>
#include <armnnUtils/DataLayoutIndexed.hpp>
#include <armnnUtils/Transpose.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <GraphTopologicalSort.hpp>
#include <ParserHelper.hpp>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/text_format.h>
#include <tensorflow/core/framework/graph.pb.h>
#include <boost/format.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/polymorphic_cast.hpp>
#include <numeric>

Go to the source code of this file.

Namespaces

 armnnTfParser
 

Macros

#define CHECK_DATA_FORMAT(NODE_DEF, FORMAT, NODE_TYPE)
 
#define CHECK_PADDING_TYPE(NODE_DEF, PADDING)
 

Functions

void CalculateSamePadding (uint32_t inputSize, uint32_t stride, uint32_t filterSize, bool samePadding, uint32_t *paddingFront, uint32_t *paddingBack)
 
void CalcPadding (uint32_t input, uint32_t kernel, uint32_t stride, uint32_t &outPadHead, uint32_t &outPadTail, bool samePadding)
 
DataType ConvertTfTensorDataType (const tensorflow::DataType tfDataType, const tensorflow::NodeDef &nodeDef)
 
TensorInfo OutputShapeOfExpandDims (const tensorflow::NodeDef &nodeDef, TensorInfo inputTensorInfo)
 
unsigned int CheckPaddingTensor (const ConstTensor &paddingTensor, const TensorInfo &inputTensorInfo, const std::string &nodeName)
 
TensorInfo CalculatePaddedOutputTensorInfo (const TensorInfo &inputTensorInfo, const std::vector< std::pair< unsigned int, unsigned int >> &padList)
 
TensorInfo OutputShapeOfSqueeze (const tensorflow::NodeDef &nodeDef, TensorInfo inputTensorInfo)
 

Macro Definition Documentation

◆ CHECK_DATA_FORMAT

#define CHECK_DATA_FORMAT (   NODE_DEF,
  FORMAT,
  NODE_TYPE 
)
Value:
if( FORMAT != "NHWC" && FORMAT != "NCHW" ) \
{ \
throw ParseException( \
boost::str( \
boost::format( \
"Unsupported data format %1% passed for %2% node %3%. " \
"Only NHWC and NCHW supported %4%") \
% FORMAT \
% NODE_TYPE \
% NODE_DEF.name() \
% CHECK_LOCATION().AsString())); \
}
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192

Definition at line 314 of file TfParser.cpp.

Referenced by armnnTfParser::ConvertTfTensorDataType(), armnnTfParser::OutputShapeOfExpandDims(), and armnnTfParser::OutputShapeOfSqueeze().

◆ CHECK_PADDING_TYPE

#define CHECK_PADDING_TYPE (   NODE_DEF,
  PADDING 
)
Value:
if(PADDING != "SAME" && PADDING != "VALID" ) \
{ \
throw ParseException( \
boost::str( \
boost::format( \
"Only 'SAME' and 'VALID' padding supported. Got %1% for %2% %3%") \
% PADDING \
% NODE_DEF.name() \
% CHECK_LOCATION().AsString())); \
} \
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192

Definition at line 328 of file TfParser.cpp.

Referenced by armnnTfParser::ConvertTfTensorDataType(), and armnnTfParser::OutputShapeOfSqueeze().