gather_nd.hpp
1 //*****************************************************************************
2 // Copyright 2017-2021 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 #pragma once
18 
19 #include "ngraph/op/op.hpp"
20 
21 namespace ngraph
22 {
23  namespace op
24  {
25  namespace v5
26  {
27  /// \brief GatherND operation
28  ///
29  class NGRAPH_API GatherND : public Op
30  {
31  public:
32  NGRAPH_RTTI_DECLARATION;
33  GatherND() = default;
34 
35  /// \brief Constructs a GatherND operation.
36  ///
37  /// \param data Node producing data that are gathered
38  /// \param indices Node producing indices by which the operation gathers elements
39  /// or slices from data
40  /// \param batch_dims Specifies a number of batch dimensions
41  GatherND(const Output<Node>& data,
42  const Output<Node>& indices,
43  const size_t batch_dims = 0);
44 
45  void validate_and_infer_types() override;
46  bool visit_attributes(AttributeVisitor& visitor) override;
47  virtual std::shared_ptr<Node>
48  clone_with_new_inputs(const OutputVector& new_args) const override;
49 
50  size_t get_batch_dims() const { return m_batch_dims; }
51  private:
52  size_t m_batch_dims;
53  };
54  }
55  }
56 }
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:71
A handle for one of a node's outputs.
Definition: node_output.hpp:42
Root of all actual ops.
Definition: op.hpp:29
GatherND operation.
Definition: gather_nd.hpp:30
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
GatherND(const Output< Node > &data, const Output< Node > &indices, const size_t batch_dims=0)
Constructs a GatherND operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28