14 #include <unordered_map> 34 const char* graphFile,
35 const std::map<std::string, armnn::TensorShape>& inputShapes,
36 const std::vector<std::string>& requestedOutputs)
override;
41 const char* protoText,
42 const std::map<std::string, armnn::TensorShape>& inputShapes,
43 const std::vector<std::string>& requestedOutputs)
override;
46 virtual BindingPointInfo GetNetworkInputBindingInfo(
const std::string& name)
const override;
49 virtual BindingPointInfo GetNetworkOutputBindingInfo(
const std::string& name)
const override;
57 void ParseInputLayer(
const caffe::LayerParameter& layerParam);
58 void ParseConvLayer(
const caffe::LayerParameter& layerParam);
59 void ParsePoolingLayer(
const caffe::LayerParameter& layerParam);
60 void ParseReluLayer(
const caffe::LayerParameter& layerParam);
61 void ParseLRNLayer(
const caffe::LayerParameter& layerParam);
62 void ParseInnerProductLayer(
const caffe::LayerParameter& layerParam);
63 void ParseSoftmaxLayer(
const caffe::LayerParameter& layerParam);
64 void ParseEltwiseLayer(
const caffe::LayerParameter& layerParam);
65 void ParseConcatLayer(
const caffe::LayerParameter& layerParam);
66 void ParseBatchNormLayer(
const caffe::LayerParameter& layerParam);
67 void ParseScaleLayer(
const caffe::LayerParameter& layerParam);
68 void ParseSplitLayer(
const caffe::LayerParameter& layerParam);
69 void ParseDropoutLayer(
const caffe::LayerParameter& layerParam);
74 void AddConvLayerWithSplits(
const caffe::LayerParameter& layerParam,
77 unsigned int kernelH);
78 void AddConvLayerWithDepthwiseConv(
const caffe::LayerParameter& layerParam,
81 unsigned int kernelH);
93 const char* bindingPointDesc,
94 std::unordered_map<std::string, BindingPointInfo>& nameToBindingInfo);
101 void SetArmnnOutputSlotForCaffeTop(
const std::string& caffeTopName,
armnn::IOutputSlot& armnnOutputSlot);
105 armnn::IOutputSlot& GetArmnnOutputSlotForCaffeTop(
const std::string& caffeTopName)
const;
107 static std::pair<armnn::LayerBindingId, armnn::TensorInfo> GetBindingInfo(
108 const std::string& layerName,
109 const char* bindingPointDesc,
110 const std::unordered_map<std::string, BindingPointInfo>& bindingInfos);
143 caffe::NetParameter& netParam,
144 const std::map<std::string, armnn::TensorShape>& inputShapes,
145 const std::vector<std::string>& requestedOutputs);
148 void LoadNetParam(caffe::NetParameter& netParameter);
151 std::vector<const caffe::LayerParameter*> GetInputs(
const caffe::LayerParameter& layerParam);
155 void ResolveInPlaceLayers(caffe::NetParameter& netParameter);
165 const char* graphFile,
166 const std::map<std::string, armnn::TensorShape>& inputShapes,
167 const std::vector<std::string>& requestedOutputs)
override;
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
A Convolution2dDescriptor for the Convolution2dLayer.
static const std::map< std::string, OperationParsingFunction > ms_CaffeLayerNameToParsingFunctions
Maps Caffe layer names to parsing member functions.
std::vector< std::string > m_RequestedOutputs
Caffe networks are loaded from protobuf files (binary or text) using the protobuf library and the gen...
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
An output connection slot for a layer.
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::unordered_map< std::string, BindingPointInfo > m_NetworkInputsBindingInfo
maps input layer names to their corresponding ids and tensor infos
std::unordered_map< std::string, BindingPointInfo > m_NetworkOutputsBindingInfo
maps output layer names to their corresponding ids and tensor infos
std::map< std::string, armnn::TensorShape > m_InputShapes
void(CaffeParserBase::*)(const caffe::LayerParameter &layerParam) OperationParsingFunction
std::pair< armnn::LayerBindingId, armnn::TensorInfo > BindingPointInfo
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
std::map< std::string, const caffe::LayerParameter * > m_CaffeLayersByTopName
armnn::INetworkPtr m_Network