gather_elements.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 v6
14  {
15  /// \brief GatherElements operation
16  ///
17  class NGRAPH_API GatherElements : public Op
18  {
19  public:
20  NGRAPH_RTTI_DECLARATION;
21  GatherElements() = default;
22 
23  /// \brief Constructs a GatherElements operation.
24  ///
25  /// \param data Node producing data that are gathered
26  /// \param indices Node producing indices by which the operation gathers elements
27  /// \param axis specifies axis along which indices are specified
29  const Output<Node>& indices,
30  const int64_t axis);
31 
32  void validate_and_infer_types() override;
33  bool visit_attributes(AttributeVisitor& visitor) override;
34  std::shared_ptr<Node>
35  clone_with_new_inputs(const OutputVector& new_args) const override;
36 
37  int64_t get_axis() const { return m_axis; }
38 
39  private:
40  int64_t m_axis;
41  };
42  } // namespace v6
43  } // namespace op
44 } // 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
GatherElements operation.
Definition: gather_elements.hpp:18
GatherElements(const Output< Node > &data, const Output< Node > &indices, const int64_t axis)
Constructs a GatherElements operation.
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16