2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
12 template <typename Parameters>
13 class LayerWithParameters : public Layer
16 using DescriptorType = Parameters;
18 const Parameters& GetParameters() const { return m_Param; }
20 /// Helper to serialize the layer parameters to string
21 /// (currently used in DotSerializer and company).
22 void SerializeLayerParameters(ParameterStringifyFunction & fn) const
24 StringifyLayerParameters<Parameters>::Serialize(fn, m_Param);
28 LayerWithParameters(unsigned int numInputSlots,
29 unsigned int numOutputSlots,
31 const Parameters& param,
33 : Layer(numInputSlots, numOutputSlots, type, name)
38 ~LayerWithParameters() = default;
40 /// Helper function to reduce duplication in *Layer::CreateWorkload.
41 template <typename QueueDescriptor>
42 WorkloadInfo PrepInfoAndDesc(QueueDescriptor& descriptor, const Graph& graph) const
44 descriptor.m_Parameters = m_Param;
45 return Layer::PrepInfoAndDesc(descriptor, graph);
48 /// The parameters for the layer (not including tensor-valued weights etc.).