ie_eltwise_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 <string>
10 #include <vector>
11 
12 namespace InferenceEngine {
13 namespace Builder {
14 
15 /**
16  * @brief The class represents a builder for Eltwise layer
17  */
18 class INFERENCE_ENGINE_API_CLASS(EltwiseLayer): public LayerFragment {
19 public:
20  /**
21  * @brief The enum defines all Eltwise types
22  */
23  enum EltwiseType {
24  SUM = 1,
25  MAX,
26  MUL
27  };
28 
29  /**
30  * @brief The constructor creates a builder with the name
31  * @param name Layer name
32  */
33  explicit EltwiseLayer(const std::string& name = "");
34  /**
35  * @brief The constructor creates a builder from generic builder
36  * @param genLayer generic builder
37  */
38  explicit EltwiseLayer(Layer& genLayer);
39  /**
40  * @brief Sets the name for the layer
41  * @param name Layer name
42  * @return reference to layer builder
43  */
44  EltwiseLayer& setName(const std::string& name);
45 
46  /**
47  * @brief Returns input ports
48  * @return Vector of input ports
49  */
50  const std::vector<Port>& getInputPorts() const;
51  /**
52  * @brief Sets input ports
53  * @param ports Vector of input ports
54  * @return reference to layer builder
55  */
56  EltwiseLayer& setInputPorts(const std::vector<Port>& ports);
57  /**
58  * @brief Returns output port
59  * @return Output port
60  */
61  const Port& getOutputPort() const;
62  /**
63  * @brief Sets output port
64  * @param port Output port
65  * @return reference to layer builder
66  */
67  EltwiseLayer& setOutputPort(const Port& port);
68  /**
69  * @brief Returns eltwise type
70  * @return Eltwise type
71  */
72  EltwiseType getEltwiseType() const;
73  /**
74  * @brief Sets eltwise type
75  * @param type Eltwise type
76  * @return reference to layer builder
77  */
78  EltwiseLayer& setEltwiseType(EltwiseType type);
79  /**
80  * @brief Returns eltwise scales
81  * @return Vector of scales
82  */
83  const std::vector<float> getScales() const;
84  /**
85  * @brief Sets eltwise scales
86  * @param scales Vector of scales
87  * @return reference to layer builder
88  */
89  EltwiseLayer& setScales(const std::vector<float>& scales);
90 
91 private:
92  EltwiseType type;
93 };
94 
95 } // namespace Builder
96 } // namespace InferenceEngine
Definition: ie_argmax_layer.hpp:11
a header file for the Inference Engine Network interface