2 // Copyright (c) 2016-2018 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 method for Pooling layer ( @CLDNN_PRIMITIVE_DESC{pooling} ).
34 typedef enum /*:int32_t*/
36 /// @brief Maximum-pooling method.
38 /// @brief Average-pooling method.
39 cldnn_pooling_average,
40 /// @brief Average-pooling method without values which are outside of the input.
41 cldnn_pooling_average_no_padding,
42 /// @brief Maximum-pooling method with additional buffer to store argmax indices.
43 cldnn_pooling_max_with_argmax,
44 /// @brief Pooling with bilinear interpolation
45 cldnn_pooling_bilinear
48 /// @brief Performs "pooling" operation which is a form of non-linear down-sampling.
49 /// @details Pools the input image by taking the max, average, etc. within regions.
50 CLDNN_BEGIN_PRIMITIVE_DESC(pooling)
51 /// @brief Primitive id which contains indices of each max pooling region. Indices must be in flattened bfyx format with no padding. Needs to be fp32 data type.
52 cldnn_primitive_id argmax;
53 /// @brief Pooling method. See #cldnn_pooling_mode.
55 /// @brief Global pooling (kernel size is equal to the spatial dimension of input tensor)
56 int8_t global_pooling;
57 /// @brief Defines a shift, relative to (0,0) position of the input buffer, where (0,0) point of the pooling window should start calculations.
58 cldnn_tensor input_offset;
59 /// @brief Defines shift in input buffer between adjacent calculations of output values.
61 /// @brief Pooling kernel size.
63 /// @brief Indicates that the primitive has user-defined output size (non-zero value).
64 uint32_t with_output_size;
65 /// @brief User-defined output data size of the primitive (w/o padding).
66 cldnn_tensor output_size;
67 CLDNN_END_PRIMITIVE_DESC(pooling)
69 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(pooling);
78 #endif /* POOLING_H */