Release 18.08
[platform/upstream/armnn.git] / src / armnn / layers / Convolution2dLayer.hpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
4 //
5 #pragma once
6
7 #include "LayerWithParameters.hpp"
8
9 namespace armnn
10 {
11
12 class ScopedCpuTensorHandle;
13
14 class Convolution2dLayer : public LayerWithParameters<Convolution2dDescriptor>
15 {
16 public:
17     std::unique_ptr<ScopedCpuTensorHandle> m_Weight;
18     std::unique_ptr<ScopedCpuTensorHandle> m_Bias;
19
20     virtual std::unique_ptr<IWorkload> CreateWorkload(const Graph&            graph,
21                                                       const IWorkloadFactory& factory) const override;
22
23     Convolution2dLayer* Clone(Graph& graph) const override;
24
25     void ValidateTensorShapesFromInputs() override;
26
27     std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
28
29 protected:
30     Convolution2dLayer(const Convolution2dDescriptor& param, const char* name);
31     ~Convolution2dLayer() = default;
32
33     ConstantTensors GetConstantTensorsByRef() override;
34 };
35
36 } // namespace