ArmNN
 23.05
LayerCloneBase.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include <Layer.hpp>
8 #include <Graph.hpp>
9 
10 namespace armnn
11 {
12 
13 template <typename LayerType, typename ... Params>
14 LayerType* Layer::CloneBase(Graph& graph, Params&& ... params) const
15 {
16  LayerType* const layer = graph.AddLayer<LayerType>(std::forward<Params>(params)...);
17 
18  layer->BackendSelectionHint(GetBackendHint());
19  layer->SetBackendId(GetBackendId());
20  layer->SetGuid(GetGuid());
21  layer->SetShapeInferenceMethod(m_ShapeInferenceMethod);
22  layer->SetAllowExpandedDims(m_AllowExpandedDims);
23 
24  return layer;
25 }
26 
27 } // namespace
armnn::Layer::CloneBase
LayerType * CloneBase(Graph &graph, Params &&... params) const
Definition: LayerCloneBase.hpp:14
armnn::Layer::m_ShapeInferenceMethod
ShapeInferenceMethod m_ShapeInferenceMethod
Definition: Layer.hpp:427
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::LayerType
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition: Types.hpp:479
armnn::Layer::GetBackendId
const BackendId & GetBackendId() const
Definition: Layer.hpp:277
Layer.hpp
armnn::Layer::GetGuid
LayerGuid GetGuid() const final
Returns the unique id of the layer.
Definition: Layer.hpp:330
armnn::Graph
Definition: Graph.hpp:30
armnn::Layer::GetBackendHint
Optional< BackendId > GetBackendHint() const
Definition: Layer.hpp:342
armnn::Graph::AddLayer
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:456
Graph.hpp