14 #include <unordered_map> 34 const char* graphFile,
35 const std::map<std::string, armnn::TensorShape>& inputShapes,
36 const std::vector<std::string>& requestedOutputs);
40 const char* graphFile,
41 const std::map<std::string, armnn::TensorShape>& inputShapes,
42 const std::vector<std::string>& requestedOutputs) = 0;
47 const char* protoText,
48 const std::map<std::string, armnn::TensorShape>& inputShapes,
49 const std::vector<std::string>& requestedOutputs);
67 void ParseInputLayer(
const caffe::LayerParameter& layerParam);
68 void ParseConvLayer(
const caffe::LayerParameter& layerParam);
69 void ParseDeconvLayer(
const caffe::LayerParameter& layerParam);
70 void ParsePoolingLayer(
const caffe::LayerParameter& layerParam);
71 void ParseReluLayer(
const caffe::LayerParameter& layerParam);
72 void ParseLRNLayer(
const caffe::LayerParameter& layerParam);
73 void ParseInnerProductLayer(
const caffe::LayerParameter& layerParam);
74 void ParseSoftmaxLayer(
const caffe::LayerParameter& layerParam);
75 void ParseEltwiseLayer(
const caffe::LayerParameter& layerParam);
76 void ParseConcatLayer(
const caffe::LayerParameter& layerParam);
77 void ParseBatchNormLayer(
const caffe::LayerParameter& layerParam);
78 void ParseScaleLayer(
const caffe::LayerParameter& layerParam);
79 void ParseSplitLayer(
const caffe::LayerParameter& layerParam);
80 void ParseDropoutLayer(
const caffe::LayerParameter& layerParam);
81 void ParseArgmaxLayer(
const caffe::LayerParameter& layerParam);
86 void AddConvLayerWithSplits(
const caffe::LayerParameter& layerParam,
89 unsigned int kernelH);
90 void AddConvLayerWithDepthwiseConv(
const caffe::LayerParameter& layerParam,
93 unsigned int kernelH);
94 void AddDeconvLayerWithSplits(
const caffe::LayerParameter& layerParam,
97 unsigned int kernelH);
101 armnn::TensorInfo BlobShapeToTensorInfo(
const caffe::BlobShape& blobShape)
const;
109 const char* bindingPointDesc,
110 std::unordered_map<std::string, BindingPointInfo>& nameToBindingInfo);
117 void SetArmnnOutputSlotForCaffeTop(
const std::string& caffeTopName,
armnn::IOutputSlot& armnnOutputSlot);
121 armnn::IOutputSlot& GetArmnnOutputSlotForCaffeTop(
const std::string& caffeTopName)
const;
123 static std::pair<armnn::LayerBindingId, armnn::TensorInfo> GetBindingInfo(
124 const std::string& layerName,
125 const char* bindingPointDesc,
126 const std::unordered_map<std::string, BindingPointInfo>& bindingInfos);
159 caffe::NetParameter& netParam,
160 const std::map<std::string, armnn::TensorShape>& inputShapes,
161 const std::vector<std::string>& requestedOutputs);
164 void LoadNetParam(caffe::NetParameter& netParameter);
167 std::vector<const caffe::LayerParameter*> GetInputs(
const caffe::LayerParameter& layerParam);
171 void ResolveInPlaceLayers(caffe::NetParameter& netParameter);
181 const char* graphFile,
182 const std::map<std::string, armnn::TensorShape>& inputShapes,
183 const std::vector<std::string>& requestedOutputs)
override;
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
std::map< std::string, armnn::TensorShape > m_InputShapes
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
A Convolution2dDescriptor for the Convolution2dLayer.
std::vector< std::string > m_RequestedOutputs
Caffe networks are loaded from protobuf files (binary or text) using the protobuf library and the gen...
const std::string GetVersion()
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
std::unordered_map< std::string, BindingPointInfo > m_NetworkOutputsBindingInfo
maps output layer names to their corresponding ids and tensor infos
An output connection slot for a layer.
static const std::map< std::string, OperationParsingFunction > ms_CaffeLayerNameToParsingFunctions
Maps Caffe layer names to parsing member functions.
std::unordered_map< std::string, BindingPointInfo > m_NetworkInputsBindingInfo
maps input layer names to their corresponding ids and tensor infos
std::pair< armnn::LayerBindingId, armnn::TensorInfo > BindingPointInfo
armnn::INetworkPtr m_Network
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...
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
void(CaffeParserImpl::*)(const caffe::LayerParameter &layerParam) OperationParsingFunction
std::map< std::string, const caffe::LayerParameter * > m_CaffeLayersByTopName