Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / index_select.h
1 // Copyright (c) 2018 Intel Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 ///////////////////////////////////////////////////////////////////////////////////////////////////
16 #ifndef INDEX_SELECT_H
17 #define INDEX_SELECT_H
18
19 #include "cldnn.h"
20
21 #include <stdbool.h>
22
23 /// @addtogroup c_api C API
24 /// @{
25 /// @addtogroup c_topology Network Topology
26 /// @{
27 /// @addtogroup c_primitives Primitives
28 /// @{
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /// @brief Select index, which will be copied to the output..
35 ///
36 /// @details Applies index selecting along specified dimension. The indices, which will be copied are specifed by 
37 ///          by @c indices.
38 /// @n
39 /// @n Example:
40 /// @n      <tt>input_sizes  = (1, 2, 4, 2)</tt>
41 /// @n      <tt>input_values = (a, b, c, d)</tt>
42 /// @n      <tt>               (e, f, g, h)</tt>
43 /// @n      <tt>indices_sizes  = (1, 1, 6, 1)</tt>
44 /// @n      <tt>indices_values = {0, 0, 1, 1, 3, 3}</tt>                  
45 /// @n  For axis: along_x:
46 /// @n      <tt>output_sizes  = (1, 2, 6, 2)</tt>
47 /// @n      <tt>output_values = (a, a, b, b, d, d)</tt>
48 /// @n      <tt>                (e, e, f, f, h, h)</tt>
49 /// @n
50 /// @n The resulting output will have sizes equal to input_size with changed concrete tensor size to inidices x size.
51 /// @n
52 /// @n@b Requirements:
53 /// @n - @c input must be a valid primitive_id, which output's format is bfyx/yxfb;
54 /// @n - @c indices must be a valid primitive_id, which output's layout is: (bfyx/yxfb, i32, {1, 1, indicies_size, 1})
55 /// @n - @c axis - valid index_select_axis_name instance. 
56 /// @n Breaking any of this conditions will cause exeption throw.
57 CLDNN_BEGIN_PRIMITIVE_DESC(index_select)
58
59 /// @brief A list of axes of index selecting.
60 index_select_axis_name_arr axis;
61 /// @brief Number of axes of index selecting.
62 int axis_num;
63 /// @brief Do index_select in reverse order on axis.
64 bool reverse;
65
66 CLDNN_END_PRIMITIVE_DESC(index_select)
67
68
69 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(index_select);
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 /// @}
76 /// @}
77 /// @}
78 #endif // INDEX_SELECT_H