11 #include <common/include/ProfilingGuid.hpp>
13 #include <unordered_map>
15 #include "ArmnnSchema_generated.h"
27 const std::vector<armnn::ConstTensor>& constants,
36 return m_flatBufferBuilder;
51 return m_serializedLayers;
54 flatbuffers::Offset<armnnSerializer::FeatureCompatibilityVersions>
GetVersionTable();
58 flatbuffers::Offset<armnnSerializer::LayerBase> CreateLayerBase(
63 void CreateAnyLayer(
const flatbuffers::Offset<void>& layer,
const armnnSerializer::Layer serializerLayer);
66 flatbuffers::Offset<armnnSerializer::ConstTensor> CreateConstTensorInfo(
70 flatbuffers::Offset<TensorInfo> CreateTensorInfo(
const armnn::TensorInfo& tensorInfo);
73 flatbuffers::Offset<flatbuffers::Vector<T>> CreateDataVector(
const void* memory,
unsigned int size);
79 std::vector<flatbuffers::Offset<armnnSerializer::InputSlot>> CreateInputSlots(
83 std::vector<flatbuffers::Offset<armnnSerializer::OutputSlot>> CreateOutputSlots(
87 flatbuffers::FlatBufferBuilder m_flatBufferBuilder;
90 std::vector<flatbuffers::Offset<armnnSerializer::AnyLayer>> m_serializedLayers;
93 std::vector<int> m_inputIds;
96 std::vector<int> m_outputIds;
99 std::unordered_map<LayerGuid, uint32_t > m_guidMap;
107 const char* name =
nullptr);
110 const char* name =
nullptr);
114 const char* name =
nullptr);
118 const char* name =
nullptr);
122 const char* name =
nullptr);
126 const std::vector<armnn::ConstTensor>& constants,
127 const char* name =
nullptr);
130 const char* name =
nullptr);
134 const char* name =
nullptr);
138 const char* name =
nullptr);
142 const char* name =
nullptr);
145 const std::vector<armnn::ConstTensor>& constants,
146 const char* name =
nullptr);
150 const char* name =
nullptr);
154 const char* name =
nullptr);
158 const char* name =
nullptr);
162 const char* name =
nullptr);
165 const char* name =
nullptr);
169 const std::vector<armnn::ConstTensor>& constants,
170 const char* name =
nullptr);
173 const char* name =
nullptr);
177 const char* name =
nullptr);
181 const char* name =
nullptr);
185 const char* name =
nullptr);
188 const char *name =
nullptr);
192 const char* name =
nullptr);
196 const char* name =
nullptr);
199 const char* name =
nullptr);
203 const char* name =
nullptr);
207 const char* name =
nullptr);
211 const char* name =
nullptr);
215 const char* name =
nullptr);
219 const char* name =
nullptr);
223 const std::vector<armnn::ConstTensor>& constants,
224 const char* name =
nullptr);
231 const char* name =
nullptr);
234 const char* name =
nullptr);
237 const char* name =
nullptr);
240 const char* name =
nullptr);
244 const char* name =
nullptr);
248 const char* name =
nullptr);
252 const char* name =
nullptr);
256 const char* name =
nullptr);
260 const char* name =
nullptr);
263 const char* name =
nullptr);
266 const char* name =
nullptr);
270 const std::vector<armnn::ConstTensor>& constants,
271 const char* name =
nullptr);
274 const std::vector<armnn::ConstTensor>& constants,
275 const char* name =
nullptr);
278 const char* name =
nullptr);
282 const char* name =
nullptr);
286 const char* name =
nullptr);
290 const char* name =
nullptr);
293 const char* name =
nullptr);
297 const char* name =
nullptr);
301 const char* name =
nullptr);
305 const char* name =
nullptr);
309 const char* name =
nullptr);
313 const char* name =
nullptr);
320 const char* name =
nullptr);
324 const char* name =
nullptr);
328 const char* name =
nullptr);
332 const char* name =
nullptr);
336 const char* name =
nullptr);
339 const char* name =
nullptr);
342 const char* name =
nullptr);
350 const std::vector<armnn::ConstTensor>& constants,
351 const char* =
nullptr);
355 const char* name =
nullptr);
359 const std::vector<armnn::ConstTensor>& constants,
360 const char* name =
nullptr);
arm::pipe::ProfilingGuid LayerGuid
Define LayerGuid type.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Main network class which provides the interface for building up a neural network.
bool SaveSerializedToStream(std::ostream &stream)
Serializes the SerializedGraph to the stream.
void Serialize(const armnn::INetwork &inNetwork)
Serializes the network to ArmNN SerializedGraph.
~SerializerImpl()=default
std::vector< int > & GetOutputIds()
std::vector< flatbuffers::Offset< armnnSerializer::AnyLayer > > & GetSerializedLayers()
flatbuffers::Offset< armnnSerializer::FeatureCompatibilityVersions > GetVersionTable()
void ExecuteStrategy(const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id) override
flatbuffers::FlatBufferBuilder & GetFlatBufferBuilder()
std::vector< int > & GetInputIds()
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
An ActivationDescriptor for the ActivationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Base class for all descriptors.
A BatchMatMulDescriptor for the BatchMatMul operator.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
A ComparisonDescriptor for the ComparisonLayer.
A Convolution2dDescriptor for the Convolution2dLayer.
A Convolution3dDescriptor for the Convolution3dLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A ElementwiseBinaryDescriptor for the ElementwiseBinaryLayer.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
A FillDescriptor for the FillLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A GatherDescriptor for the GatherLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
An LstmDescriptor for the LstmLayer.
A MeanDescriptor for the MeanLayer.
A NormalizationDescriptor for the NormalizationLayer.
An OriginsDescriptor for the ConcatLayer.
A PadDescriptor for the PadLayer.
A PermuteDescriptor for the PermuteLayer.
A Pooling2dDescriptor for the Pooling2dLayer.
A Pooling3dDescriptor for the Pooling3dLayer.
A QLstmDescriptor for the QLstmLayer.
A ReduceDescriptor for the REDUCE operators.
A ReshapeDescriptor for the ReshapeLayer.
A ResizeDescriptor for the ResizeLayer.
A ScatterNdDescriptor for the ScatterNdLayer.
A SliceDescriptor for the SliceLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A StackDescriptor for the StackLayer.
A StandInDescriptor for the StandIn layer.
A StridedSliceDescriptor for the StridedSliceLayer.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
A TransposeDescriptor for the TransposeLayer.
A ViewsDescriptor for the SplitterLayer.