index_reduction.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <memory>
8 #include <string>
9 #include <type_traits>
10 #include <utility>
11 
12 #include "ngraph/op/op.hpp"
13 
14 namespace ngraph
15 {
16  namespace op
17  {
18  namespace util
19  {
20  class NGRAPH_API IndexReduction : public Op
21  {
22  protected:
24 
25  IndexReduction(const Output<Node>& arg,
26  uint64_t axis,
27  const element::Type& index_element_type);
28 
29  public:
30  uint64_t get_reduction_axis() const;
31  void set_reduction_axis(uint64_t value);
32  element::Type get_index_element_type() const;
33  void set_index_element_type(const element::Type& index_element_type);
34  void validate_and_infer_types() override;
35  bool visit_attributes(AttributeVisitor& visitor) override;
36 
37  protected:
38  uint64_t m_axis{0};
39  element::Type m_index_element_type;
40  };
41  } // namespace util
42  } // namespace op
43 } // 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
Definition: element_type.hpp:51
Root of all actual ops.
Definition: op.hpp:17
Definition: index_reduction.hpp:21
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