2 // Copyright (c) 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 ///////////////////////////////////////////////////////////////////////////////////////////////////
19 #include "api/CPP/index_select.hpp"
20 #include "primitive_inst.h"
28 struct typed_program_node<index_select> : public typed_program_node_base<index_select>
30 using parent = typed_program_node_base<index_select>;
33 typed_program_node(std::shared_ptr<primitive> prim, program_impl& prog)
37 program_node& input() const { return get_dependency(0); }
38 program_node& indices() const { return get_dependency(1); }
39 bool get_reverse() const { return get_primitive()->reverse; }
40 std::vector<index_select_axis_name> get_axes() const { return get_primitive()->axis; }
43 using index_select_node = typed_program_node<index_select>;
46 class typed_primitive_inst<index_select> : public typed_primitive_inst_base<index_select>
48 using parent = typed_primitive_inst_base<index_select>;
51 static layout calc_output_layout(index_select_node const& node);
52 static std::string to_string(index_select_node const& node);
53 typed_primitive_inst(network_impl& network, index_select_node const& node);
55 memory_impl& input() const { return dep_memory(0); }
56 memory_impl& indices() const { return dep_memory(1); }
57 bool get_reverse() const { return node.get_reverse(); }
58 std::vector<index_select_axis_name> get_axes() const { return node.get_axes(); }
61 using index_select_inst = typed_primitive_inst<index_select>;