MCPcopy Create free account
hub / github.com/ARM-software/armnn / SerializeBatchToSpaceNdLayer

Method SerializeBatchToSpaceNdLayer

src/armnnSerializer/Serializer.cpp:270–298  ·  view source on GitHub ↗

Build FlatBuffer for BatchToSpaceNd Layer

Source from the content-addressed store, hash-verified

268
269// Build FlatBuffer for BatchToSpaceNd Layer
270void SerializerStrategy::SerializeBatchToSpaceNdLayer(const armnn::IConnectableLayer* layer,
271 const armnn::BatchToSpaceNdDescriptor& descriptor,
272 const char* name)
273{
274 IgnoreUnused(name);
275
276 // Create FlatBuffer BaseLayer
277 auto flatBufferBaseLayer = CreateLayerBase(layer, serializer::LayerType::LayerType_BatchToSpaceNd);
278
279 std::vector<unsigned int> crops;
280 crops.reserve(descriptor.m_Crops.size() * 2);
281 for (auto& crop : descriptor.m_Crops)
282 {
283 crops.push_back(crop.first);
284 crops.push_back(crop.second);
285 }
286
287 auto flatBufferDescriptor =
288 CreateBatchToSpaceNdDescriptor(m_flatBufferBuilder,
289 m_flatBufferBuilder.CreateVector(descriptor.m_BlockShape),
290 m_flatBufferBuilder.CreateVector(crops),
291 GetFlatBufferDataLayout(descriptor.m_DataLayout));
292
293 auto flatBufferLayer = serializer::CreateBatchToSpaceNdLayer(m_flatBufferBuilder,
294 flatBufferBaseLayer,
295 flatBufferDescriptor);
296
297 CreateAnyLayer(flatBufferLayer.o, serializer::Layer::Layer_BatchToSpaceNdLayer);
298}
299
300void SerializerStrategy::SerializeBatchNormalizationLayer(
301 const armnn::IConnectableLayer* layer,

Callers

nothing calls this directly

Calls 5

GetFlatBufferDataLayoutFunction · 0.85
push_backMethod · 0.80
IgnoreUnusedFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected