ArmNN
 20.08
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->SetBackendId(GetBackendId());
19  layer->SetGuid(GetGuid());
20  layer->SetShapeInferenceMethod(m_ShapeInferenceMethod);
21 
22  return layer;
23 }
24 
25 } // namespace
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:403
Copyright (c) 2020 ARM Limited.
LayerType * CloneBase(Graph &graph, Params &&... params) const
const BackendId & GetBackendId() const
Definition: Layer.hpp:265
ShapeInferenceMethod m_ShapeInferenceMethod
Definition: Layer.hpp:387
LayerGuid GetGuid() const final
Returns the unique id of the layer.
Definition: Layer.hpp:318