1 // Copyright (c) 2018 Intel Corporation
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
15 ///////////////////////////////////////////////////////////////////////////////////////////////////
16 #ifndef INDEX_SELECT_H
17 #define INDEX_SELECT_H
23 /// @addtogroup c_api C API
25 /// @addtogroup c_topology Network Topology
27 /// @addtogroup c_primitives Primitives
34 /// @brief Select index, which will be copied to the output..
36 /// @details Applies index selecting along specified dimension. The indices, which will be copied are specifed by
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>
50 /// @n The resulting output will have sizes equal to input_size with changed concrete tensor size to inidices x size.
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)
59 /// @brief A list of axes of index selecting.
60 index_select_axis_name_arr axis;
61 /// @brief Number of axes of index selecting.
63 /// @brief Do index_select in reverse order on axis.
66 CLDNN_END_PRIMITIVE_DESC(index_select)
69 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(index_select);
78 #endif // INDEX_SELECT_H