2 // Copyright (c) 2016-2019 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
22 /// @addtogroup c_api C API
24 /// @addtogroup c_topology Network Topology
26 /// @addtogroup c_primitives Primitives
33 /// @brief Select mode for eltwise layer ( @CLDNN_PRIMITIVE_DESC{eltwise} ).
34 typedef enum /*:int32_t*/
36 /// @brief Eltwise sum.
38 /// @brief Eltwise subtract.
40 /// @brief Eltwise max.
42 /// @brief Eltwise product (Hadamard).
44 /// @brief Eltwise div.
46 /// @brief Eltwise min.
48 /// @brief Eltwise pow.
50 /// @brief Eltwise mod.
52 /// @brief Eltwise equal.
54 /// @brief Eltwise not equal.
56 /// @brief Eltwise less.
58 /// @brief Eltwise less of equal.
60 /// @brief Eltwise greater.
62 /// @brief Eltwise greater or equal.
64 /// @brief Eltwise and.
66 /// @brief Eltwise or.
68 /// @brief Eltwise xor.
70 /// @brief Eltwise squared diff.
71 cldnn_eltwise_squared_diff
74 /// @brief Performs elementwise operations (sum, subtract, max or product) on two input primitives
75 /// Also supports built-in Relu @CLDNN_PRIMITIVE_DESC{activation} available by setting it in arguments.
77 /// - both inputs have to have equal sizes in all dimensions or the input tensors are broadcastable
78 /// to the same shape in which the size of each dimention is a max. of input sizes on this dimension)
79 /// - format of both inputs has to be the same
80 /// - when using integer types, only following eltwise modes are supported: sum, sub, prod, div
81 CLDNN_BEGIN_PRIMITIVE_DESC(eltwise)
82 /// @brief Primitive id containing output quanitization factors per output feature map.
83 cldnn_primitive_id output_calibration_factors;
84 /// @brief Output quantization factor
85 float output_quantization_factor;
86 /// @brief Eltwise mode. See #cldnn_eltwise_mode.
87 int32_t mode; /*cldnn_eltwise_mode*/
88 /// @brief Blob-wise coefficient for SUM operation
89 cldnn_float_arr coefficients;
90 /// @brief Enables Relu activation.
91 uint32_t with_activation;
92 /// @brief Relu activation slope.
93 float activation_negative_slope;
94 /// @brief Defines shift in input buffers between adjacent calculations of output values.
95 cldnn_tensor_arr stride;
97 CLDNN_END_PRIMITIVE_DESC(eltwise)
99 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(eltwise);
108 #endif /* ELTWISE_H */