ArmNN
 21.02
TfParser.cpp File Reference
#include "TfParser.hpp"
#include "armnnTfParser/Version.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 <armnn/utility/NumericCast.hpp>
#include <armnn/utility/PolymorphicDowncast.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 <fmt/core.h>
#include <fmt/format.h>
#include <iostream>
#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 CalcPadding (uint32_t inputSize, uint32_t filterSize, uint32_t stride, uint32_t dilation, uint32_t &paddingFront, uint32_t &paddingBack, bool samePadding)
 
DataType ConvertTfTensorDataType (const tensorflow::DataType tfDataType, const tensorflow::NodeDef &nodeDef)
 
TensorInfo OutputShapeOfExpandDims (const tensorflow::NodeDef &nodeDef, TensorInfo inputTensorInfo, std::int32_t expandDim)
 
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( \
fmt::format("Unsupported data format {} passed for {} node {}. " \
"Only NHWC and NCHW supported {}", \
FORMAT, \
NODE_TYPE, \
NODE_DEF.name(), \
CHECK_LOCATION().AsString())); \
}

Definition at line 356 of file TfParser.cpp.

Referenced by ITfParser::TfParserImpl::AddAdditionLayer(), ITfParser::TfParserImpl::ParseConv2D(), ITfParser::TfParserImpl::ParseDepthwiseConv2D(), ITfParser::TfParserImpl::ParseFusedBatchNorm(), and ITfParser::TfParserImpl::ParsePooling2d().

◆ CHECK_PADDING_TYPE

#define CHECK_PADDING_TYPE (   NODE_DEF,
  PADDING 
)
Value:
if(PADDING != "SAME" && PADDING != "VALID" ) \
{ \
throw ParseException( \
fmt::format("Only 'SAME' and 'VALID' padding supported. Got {} for {} {}", \
PADDING, \
NODE_DEF.name(), \
CHECK_LOCATION().AsString())); \
} \

Definition at line 368 of file TfParser.cpp.

Referenced by ITfParser::TfParserImpl::ParseConv2D(), ITfParser::TfParserImpl::ParseDepthwiseConv2D(), and ITfParser::TfParserImpl::ParsePooling2d().