ie_eltwise_layer.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <builders/ie_layer_decorator.hpp>
8 #include <ie_network.hpp>
9 #include <string>
10 #include <vector>
11 
12 namespace InferenceEngine {
13 namespace Builder {
14 
15 /**
16  * @deprecated Use ngraph API instead.
17  * @brief The class represents a builder for Eltwise layer
18  */
19 IE_SUPPRESS_DEPRECATED_START
20 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(EltwiseLayer): public LayerDecorator {
21 public:
22  /**
23  * @brief The enum defines all Eltwise types
24  */
25  enum EltwiseType { SUM = 1, MAX, MUL, SUB, DIV, MIN, SQUARED_DIFF };
26 
27  /**
28  * @brief The constructor creates a builder with the name
29  * @param name Layer name
30  */
31  explicit EltwiseLayer(const std::string& name = "");
32  /**
33  * @brief The constructor creates a builder from generic builder
34  * @param layer pointer to generic builder
35  */
36  explicit EltwiseLayer(const Layer::Ptr& layer);
37  /**
38  * @brief The constructor creates a builder from generic builder
39  * @param layer constant pointer to generic builder
40  */
41  explicit EltwiseLayer(const Layer::CPtr& layer);
42  /**
43  * @brief Sets the name for the layer
44  * @param name Layer name
45  * @return reference to layer builder
46  */
47  EltwiseLayer& setName(const std::string& name);
48 
49  /**
50  * @brief Returns input ports
51  * @return Vector of input ports
52  */
53  const std::vector<Port>& getInputPorts() const;
54  /**
55  * @brief Sets input ports
56  * @param ports Vector of input ports
57  * @return reference to layer builder
58  */
59  EltwiseLayer& setInputPorts(const std::vector<Port>& ports);
60  /**
61  * @brief Returns output port
62  * @return Output port
63  */
64  const Port& getOutputPort() const;
65  /**
66  * @brief Sets output port
67  * @param port Output port
68  * @return reference to layer builder
69  */
70  EltwiseLayer& setOutputPort(const Port& port);
71  /**
72  * @brief Returns eltwise type
73  * @return Eltwise type
74  */
75  EltwiseType getEltwiseType() const;
76  /**
77  * @brief Sets eltwise type
78  * @param type Eltwise type
79  * @return reference to layer builder
80  */
81  EltwiseLayer& setEltwiseType(EltwiseType type);
82  /**
83  * @brief Returns eltwise scales
84  * @return Vector of scales
85  */
86  const std::vector<float> getScales() const;
87  /**
88  * @brief Sets eltwise scales
89  * @param scales Vector of scales
90  * @return reference to layer builder
91  */
92  EltwiseLayer& setScales(const std::vector<float>& scales);
93 
94 private:
95  EltwiseType type = SUM;
96 };
97 IE_SUPPRESS_DEPRECATED_END
98 
99 } // namespace Builder
100 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:11