ie_convolution_layer.hpp
1 // Copyright (C) 2018 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <builders/ie_layer_fragment.hpp>
8 #include <ie_inetwork.hpp>
9 #include <vector>
10 #include <string>
11 
12 namespace InferenceEngine {
13 namespace Builder {
14 
15 /**
16  * @brief The class represents a builder for ArgMax layer
17  */
18 class INFERENCE_ENGINE_API_CLASS(ConvolutionLayer): public LayerFragment {
19 public:
20  /**
21  * @brief The constructor creates a builder with the name
22  * @param name Layer name
23  */
24  explicit ConvolutionLayer(const std::string& name = "");
25  /**
26  * @brief The constructor creates a builder from generic builder
27  * @param genLayer generic builder
28  */
29  explicit ConvolutionLayer(Layer& genLayer);
30  /**
31  * @brief Operator creates generic layer builder
32  * @return Generic layer builder
33  */
34  operator Layer() const override;
35  /**
36  * @brief Sets the name for the layer
37  * @param name Layer name
38  * @return reference to layer builder
39  */
40  ConvolutionLayer& setName(const std::string& name);
41 
42  /**
43  * @brief Sets weights for layer
44  * @param weights Constant blob with weights
45  * @return reference to layer builder
46  */
47  ConvolutionLayer& setWeights(const Blob::CPtr& weights);
48  /**
49  * @brief Sets biases for layer
50  * @param biases Constant blob with biases
51  * @return reference to layer builder
52  */
53  ConvolutionLayer& setBiases(const Blob::CPtr& biases);
54 
55  /**
56  * @brief Returns input port
57  * @return Input port
58  */
59  const Port& getInputPort() const;
60  /**
61  * @brief Sets input port
62  * @param port Input port
63  * @return reference to layer builder
64  */
65  ConvolutionLayer& setInputPort(const Port& port);
66  /**
67  * @brief Returns output port
68  * @return Output port
69  */
70  const Port& getOutputPort() const;
71  /**
72  * @brief Sets output port
73  * @param port Output port
74  * @return reference to layer builder
75  */
76  ConvolutionLayer& setOutputPort(const Port& port);
77  /**
78  * @brief Returns kernel size
79  * @return Kernel size
80  */
81  const std::vector<size_t> getKernel() const;
82  /**
83  * @brief Sets kernel size
84  * @param kernel Kernel size
85  * @return reference to layer builder
86  */
87  ConvolutionLayer& setKernel(const std::vector<size_t>& kernel);
88  /**
89  * @brief Returns vector of strides
90  * @return vector of strides
91  */
92  const std::vector<size_t> getStrides() const;
93  /**
94  * @brief Sets strides
95  * @param strides vector of strides
96  * @return reference to layer builder
97  */
98  ConvolutionLayer& setStrides(const std::vector<size_t>& strides);
99  /**
100  * @brief Returns dilations
101  * @return vector of dilations
102  */
103  const std::vector<size_t> getDilation() const;
104  /**
105  * @brief Sets dilations
106  * @param dilation Vector of dilations
107  * @return reference to layer builder
108  */
109  ConvolutionLayer& setDilation(const std::vector<size_t>& dilation);
110  /**
111  * @brief Returns begin paddings
112  * @return vector of paddings
113  */
114  const std::vector<size_t> getPaddingsBegin() const;
115  /**
116  * @brief Sets begin paddings
117  * @param paddings Vector of paddings
118  * @return reference to layer builder
119  */
120  ConvolutionLayer& setPaddingsBegin(const std::vector<size_t>& paddings);
121  /**
122  * @brief Return end paddings
123  * @return Vector of paddings
124  */
125  const std::vector<size_t> getPaddingsEnd() const;
126  /**
127  * @brief Sets end paddings
128  * @param paddings Vector of paddings
129  * @return reference to layer builder
130  */
131  ConvolutionLayer& setPaddingsEnd(const std::vector<size_t>& paddings);
132  /**
133  * @brief Returns group
134  * @return Group
135  */
136  size_t getGroup() const;
137  /**
138  * @brief Sets group
139  * @param group Group
140  * @return reference to layer builder
141  */
142  ConvolutionLayer& setGroup(size_t group);
143  /**
144  * @brief Return output depth
145  * @return Output depth
146  */
147  size_t getOutDepth() const;
148  /**
149  * @brief Sets output depth
150  * @param outDepth Output depth
151  * @return reference to layer builder
152  */
153  ConvolutionLayer& setOutDepth(size_t outDepth);
154 
155  /**
156  * @brief Validates layer before creation
157  * @param layer generic layer builder
158  */
159  static void validate(const Layer& layer);
160 };
161 
162 } // namespace Builder
163 } // namespace InferenceEngine
Definition: ie_argmax_layer.hpp:11
a header file for the Inference Engine Network interface
std::shared_ptr< const Blob > CPtr
A smart pointer to the const Blob object.
Definition: ie_blob.h:43