From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- .../classarmnn_caffe_parser_1_1_caffe_parser.xhtml | 337 +++++++++++++++++++++ 1 file changed, 337 insertions(+) create mode 100644 20.02/classarmnn_caffe_parser_1_1_caffe_parser.xhtml (limited to '20.02/classarmnn_caffe_parser_1_1_caffe_parser.xhtml') diff --git a/20.02/classarmnn_caffe_parser_1_1_caffe_parser.xhtml b/20.02/classarmnn_caffe_parser_1_1_caffe_parser.xhtml new file mode 100644 index 0000000000..3b126836f1 --- /dev/null +++ b/20.02/classarmnn_caffe_parser_1_1_caffe_parser.xhtml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + +ArmNN: CaffeParser Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
CaffeParser Class Reference
+
+
+ +

#include <CaffeParser.hpp>

+
+Inheritance diagram for CaffeParser:
+
+
+ + +CaffeParserBase +ICaffeParser + +
+ + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

virtual armnn::INetworkPtr CreateNetworkFromBinaryFile (const char *graphFile, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) override
 Create the network from a protobuf binary file on disk. More...
 
 CaffeParser ()
 
- Public Member Functions inherited from CaffeParserBase
virtual armnn::INetworkPtr CreateNetworkFromTextFile (const char *graphFile, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) override
 Create the network from a protobuf text file on disk. More...
 
virtual armnn::INetworkPtr CreateNetworkFromString (const char *protoText, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) override
 Creates the network directly from protobuf text in a string. Useful for debugging/testing. More...
 
virtual BindingPointInfo GetNetworkInputBindingInfo (const std::string &name) const override
 Retrieves binding info (layer id and tensor info) for the network input identified by the given layer name. More...
 
virtual BindingPointInfo GetNetworkOutputBindingInfo (const std::string &name) const override
 Retrieves binding info (layer id and tensor info) for the network output identified by the given layer name. More...
 
 CaffeParserBase ()
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Static Public Member Functions inherited from ICaffeParser
static ICaffeParserCreateRaw ()
 
static ICaffeParserPtr Create ()
 
static void Destroy (ICaffeParser *parser)
 
- Protected Types inherited from CaffeParserBase
using OperationParsingFunction = void(CaffeParserBase::*)(const caffe::LayerParameter &layerParam)
 
- Protected Member Functions inherited from CaffeParserBase
armnn::TensorInfo BlobShapeToTensorInfo (const caffe::BlobShape &blobShape) const
 Converts Caffe's protobuf tensor shape format to ArmNN's. More...
 
void TrackInputBinding (armnn::IConnectableLayer *layer, armnn::LayerBindingId id, const armnn::TensorInfo &tensorInfo)
 
void TrackOutputBinding (armnn::IConnectableLayer *layer, armnn::LayerBindingId id, const armnn::TensorInfo &tensorInfo)
 
void SetArmnnOutputSlotForCaffeTop (const std::string &caffeTopName, armnn::IOutputSlot &armnnOutputSlot)
 
armnn::IOutputSlotGetArmnnOutputSlotForCaffeTop (const std::string &caffeTopName) const
 Retrieves the Armnn IOutputSlot representing the given Caffe top. More...
 
void Cleanup ()
 
armnn::INetworkPtr CreateNetworkFromNetParameter (caffe::NetParameter &netParam, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs)
 Parses a NetParameter loaded into memory from one of the other CreateNetwork*. More...
 
void LoadNetParam (caffe::NetParameter &netParameter)
 does the actual conversion from caffe::NetParameter to armnn::INetwork More...
 
std::vector< const caffe::LayerParameter * > GetInputs (const caffe::LayerParameter &layerParam)
 Find the Caffe layers listed as inputs (bottoms) for a given layer. More...
 
void ResolveInPlaceLayers (caffe::NetParameter &netParameter)
 Modifies the Caffe network to replace "in-place" layers (whose top() and bottom() are both the same) with regular layers. More...
 
void ParseInputLayer (const caffe::LayerParameter &layerParam)
 Adds an armnn layer to m_Network given a Caffe LayerParameter of the correct type and is responsible for recording any newly created IOutputSlots using SetArmnnOutputSlotForCaffeTop(). More...
 
void ParseConvLayer (const caffe::LayerParameter &layerParam)
 
void ParsePoolingLayer (const caffe::LayerParameter &layerParam)
 
void ParseReluLayer (const caffe::LayerParameter &layerParam)
 
void ParseLRNLayer (const caffe::LayerParameter &layerParam)
 
void ParseInnerProductLayer (const caffe::LayerParameter &layerParam)
 
void ParseSoftmaxLayer (const caffe::LayerParameter &layerParam)
 
void ParseEltwiseLayer (const caffe::LayerParameter &layerParam)
 
void ParseConcatLayer (const caffe::LayerParameter &layerParam)
 
void ParseBatchNormLayer (const caffe::LayerParameter &layerParam)
 
void ParseScaleLayer (const caffe::LayerParameter &layerParam)
 
void ParseSplitLayer (const caffe::LayerParameter &layerParam)
 
void ParseDropoutLayer (const caffe::LayerParameter &layerParam)
 
void AddConvLayerWithSplits (const caffe::LayerParameter &layerParam, const armnn::Convolution2dDescriptor &desc, unsigned int kernelW, unsigned int kernelH)
 ParseConv may use these helpers depending on the group parameter. More...
 
void AddConvLayerWithDepthwiseConv (const caffe::LayerParameter &layerParam, const armnn::Convolution2dDescriptor &desc, unsigned int kernelW, unsigned int kernelH)
 
- Protected Member Functions inherited from ICaffeParser
virtual ~ICaffeParser ()
 
- Static Protected Member Functions inherited from CaffeParserBase
static void TrackBindingPoint (armnn::IConnectableLayer *layer, armnn::LayerBindingId id, const armnn::TensorInfo &tensorInfo, const char *bindingPointDesc, std::unordered_map< std::string, BindingPointInfo > &nameToBindingInfo)
 
static std::pair< armnn::LayerBindingId, armnn::TensorInfoGetBindingInfo (const std::string &layerName, const char *bindingPointDesc, const std::unordered_map< std::string, BindingPointInfo > &bindingInfos)
 
- Protected Attributes inherited from CaffeParserBase
std::unordered_map< std::string, BindingPointInfom_NetworkInputsBindingInfo
 maps input layer names to their corresponding ids and tensor infos More...
 
std::unordered_map< std::string, BindingPointInfom_NetworkOutputsBindingInfo
 maps output layer names to their corresponding ids and tensor infos More...
 
armnn::INetworkPtr m_Network
 
std::map< std::string, armnn::TensorShapem_InputShapes
 
std::unordered_map< std::string, armnn::IOutputSlot * > m_ArmnnOutputSlotForCaffeTop
 As we add armnn layers we store the armnn IOutputSlot which corresponds to the Caffe tops. More...
 
std::vector< std::string > m_RequestedOutputs
 
std::map< std::string, const caffe::LayerParameter * > m_CaffeLayersByTopName
 
- Static Protected Attributes inherited from CaffeParserBase
static const std::map< std::string, OperationParsingFunctionms_CaffeLayerNameToParsingFunctions
 Maps Caffe layer names to parsing member functions. More...
 
+

Detailed Description

+
+

Definition at line 159 of file CaffeParser.hpp.

+

Constructor & Destructor Documentation

+ +

◆ CaffeParser()

+ +
+
+ + + + + + + +
CaffeParser ()
+
+ +

Definition at line 280 of file CaffeParser.cpp.

+
281 : CaffeParserBase()
282 {
283 
284 }
+
+
+
+

Member Function Documentation

+ +

◆ CreateNetworkFromBinaryFile()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
INetworkPtr CreateNetworkFromBinaryFile (const char * graphFile,
const std::map< std::string, armnn::TensorShape > & inputShapes,
const std::vector< std::string > & requestedOutputs 
)
+
+overridevirtual
+
+ +

Create the network from a protobuf binary file on disk.

+ +

Implements ICaffeParser.

+ +

Definition at line 1789 of file CaffeParser.cpp.

+ +

References CHECK_LOCATION, and CaffeParserBase::CreateNetworkFromNetParameter().

+
1792 {
1793  FILE* fd = fopen(graphFile, "rb");
1794 
1795  if (fd == nullptr)
1796  {
1797  throw FileNotFoundException(
1798  boost::str(
1799  boost::format(
1800  "Failed to open graph file at: %1% %2%") %
1801  graphFile %
1802  CHECK_LOCATION().AsString()));
1803  }
1804 
1805  // Parses the file into a message.
1806  NetParameter netParam;
1807 
1808  FileInputStream inStream(fileno(fd));
1809  CodedInputStream codedStream(&inStream);
1810  codedStream.SetTotalBytesLimit(INT_MAX, INT_MAX);
1811  bool success = netParam.ParseFromCodedStream(&codedStream);
1812  fclose(fd);
1813 
1814  if (!success)
1815  {
1816  throw ParseException(
1817  boost::str(
1818  boost::format(
1819  "Failed to parse protobuf file: %1% %2%") %
1820  graphFile %
1821  CHECK_LOCATION().AsString()));
1822  }
1823 
1824  return CreateNetworkFromNetParameter(netParam, inputShapes, requestedOutputs);
1825 }
+
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192
+
armnn::INetworkPtr CreateNetworkFromNetParameter(caffe::NetParameter &netParam, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs)
Parses a NetParameter loaded into memory from one of the other CreateNetwork*.
+ +
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1