scatter_nd_base.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 util
14  {
15  ///
16  /// \brief Base class for ScatterNDXXX operators.
17  ///
18  class NGRAPH_API ScatterNDBase : public Op
19  {
20  public:
21  static constexpr NodeTypeInfo type_info{"ScatterNDBase", 3};
22  const NodeTypeInfo& get_type_info() const override { return type_info; }
23  // Respective input ordinal number.
24  static constexpr int INPUTS = 0;
25  static constexpr int INDICES = 1;
26  static constexpr int UPDATES = 2;
27  virtual void validate_and_infer_types() override;
28  virtual bool visit_attributes(AttributeVisitor& visitor) override;
29 
30  protected:
31  ScatterNDBase() = default;
32 
33  ///
34  /// \brief Constructs ScatterNDBase object.
35  ///
36  /// \param inputs The input tensor to be updated.
37  /// \param indices The tensor with indexes which will be updated.
38  /// \param updates The tensor with update values.
39  ///
40  ScatterNDBase(const Output<Node>& inputs,
41  const Output<Node>& indices,
42  const Output<Node>& updates);
43  };
44  } // namespace util
45  } // namespace op
46 } // 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
Base class for ScatterNDXXX operators.
Definition: scatter_nd_base.hpp:19
ScatterNDBase(const Output< Node > &inputs, const Output< Node > &indices, const Output< Node > &updates)
Constructs ScatterNDBase object.
virtual void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
const NodeTypeInfo & get_type_info() const override
Definition: scatter_nd_base.hpp:22
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27