gather_elements.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 v6
26  {
27  /// \brief GatherElements operation
28  ///
29  class NGRAPH_API GatherElements : public Op
30  {
31  public:
32  NGRAPH_RTTI_DECLARATION;
33  GatherElements() = default;
34 
35  /// \brief Constructs a GatherElements operation.
36  ///
37  /// \param data Node producing data that are gathered
38  /// \param indices Node producing indices by which the operation gathers elements
39  /// \param axis specifies axis along which indices are specified
41  const Output<Node>& indices,
42  const int64_t axis);
43 
44  void validate_and_infer_types() override;
45  bool visit_attributes(AttributeVisitor& visitor) override;
46  std::shared_ptr<Node>
47  clone_with_new_inputs(const OutputVector& new_args) const override;
48 
49  int64_t get_axis() const { return m_axis; }
50  private:
51  int64_t m_axis;
52  };
53  }
54  }
55 }
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
GatherElements operation.
Definition: gather_elements.hpp:30
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:28