gather_nd.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/op/op.hpp"
8 
9 namespace ngraph
10 {
11  namespace op
12  {
13  namespace v5
14  {
15  /// \brief GatherND operation
16  ///
17  class NGRAPH_API GatherND : public Op
18  {
19  public:
20  NGRAPH_RTTI_DECLARATION;
21  GatherND() = default;
22 
23  /// \brief Constructs a GatherND operation.
24  ///
25  /// \param data Node producing data that are gathered
26  /// \param indices Node producing indices by which the operation gathers elements
27  /// or slices from data
28  /// \param batch_dims Specifies a number of batch dimensions
29  GatherND(const Output<Node>& data,
30  const Output<Node>& indices,
31  const size_t batch_dims = 0);
32 
33  void validate_and_infer_types() override;
34  bool visit_attributes(AttributeVisitor& visitor) override;
35  virtual std::shared_ptr<Node>
36  clone_with_new_inputs(const OutputVector& new_args) const override;
37 
38  size_t get_batch_dims() const { return m_batch_dims; }
39 
40  private:
41  size_t m_batch_dims;
42  };
43  } // namespace v5
44  } // namespace op
45 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Root of all actual ops.
Definition: op.hpp:17
GatherND operation.
Definition: gather_nd.hpp:18
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:16