Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api_extension / C / fused_conv_bn_scale.h
1 /*
2 // Copyright (c) 2018 Intel Corporation
3 //
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
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 */
16
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #ifndef FUSED_CONV_BN_SCALE_H
19 #define FUSED_CONV_BN_SCALE_H
20
21 #include "api/C/cldnn.h"
22 /// @addtogroup c_api C API
23 /// @{
24 /// @addtogroup c_topology Network Topology
25 /// @{
26 /// @addtogroup c_primitives Primitives
27 /// @{
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /// @brief Primitives that fuses convolution, batch norm, scale and optionally Relu.
34 CLDNN_BEGIN_PRIMITIVE_DESC(fused_conv_bn_scale)
35 /// @brief Defines a shift, relative to (0,0) position of the input buffer, where (0,0) point of the convolution window should start calculations.
36 cldnn_tensor input_offset;
37 /// @brief Defines shift in input buffer between adjacent calculations of output values.
38 cldnn_tensor stride;
39 /// @brief Defines gaps in the input - dilation rate k=1 is normal convolution, k=2 means skipping one pixel per input, k=4 means skipping 3 pixels.
40 /// As an example in one dimension, a filter w of size 3 would compute over input x the following: w[0]*x[0] + w[1]*x[1] + w[2]*x[2] for dilation of 1. 
41 /// For dilation 2 the filter would instead compute w[0]*x[0] + w[1]*x[2] + w[2]*x[4].
42 cldnn_tensor dilation;
43 /// @brief Enable Relu activation.
44 uint32_t with_activation;
45 /// @brief Relu activation slope.
46 float activation_negative_slope;
47 /// @brief On how many cards split the computation to.
48 uint32_t split;
49 /// @brief Array of primitive ids containing weights data. Size of array should be equivalent to @p split.
50 cldnn_primitive_id_arr weights;
51 /// @brief Array of primitive ids containing bias data. Size of array should be equivalent to @p split.
52 cldnn_primitive_id_arr bias;
53 /// @brief Primitive id containing scale bias data for fused convolution.
54 cldnn_primitive_id scale_bias;
55 /// @brief Primitive id containing inverted variance used in future gradient computing for fused convolution.
56 cldnn_primitive_id inv_variance;
57 /// @brief Epsilon for fused convolution.
58 float epsilon;
59 /// @brief Indicates that primitive is fused with batch norm and scale.
60 uint32_t fused_batch_norm_scale;
61 CLDNN_END_PRIMITIVE_DESC(fused_conv_bn_scale)
62
63 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(fused_conv_bn_scale);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 /// @}
70 /// @}
71 /// @}
72 #endif /* FUSED_CONV_BN_SCALE.H */
73