scatter_nd_base.hpp
1 //*****************************************************************************
2 // Copyright 2017-2020 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 util
26  {
27  ///
28  /// \brief Base class for ScatterNDXXX operators.
29  ///
30  class NGRAPH_API ScatterNDBase : public Op
31  {
32  public:
33  static constexpr NodeTypeInfo type_info{"ScatterNDBase", 3};
34  const NodeTypeInfo& get_type_info() const override { return type_info; }
35  // Respective input ordinal number.
36  static constexpr int INPUTS = 0;
37  static constexpr int INDICES = 1;
38  static constexpr int UPDATES = 2;
39  virtual void validate_and_infer_types() override;
40  virtual bool visit_attributes(AttributeVisitor& visitor) override;
41 
42  protected:
43  ScatterNDBase() = default;
44 
45  ///
46  /// \brief Constructs ScatterNDBase object.
47  ///
48  /// \param inputs The input tensor to be updated.
49  /// \param indices The tensor with indexes which will be updated.
50  /// \param updates The tensor with update values.
51  ///
52  ScatterNDBase(const Output<Node>& inputs,
53  const Output<Node>& indices,
54  const Output<Node>& updates);
55  };
56  }
57  }
58 }
ngraph::op::util::ScatterNDBase::ScatterNDBase
ScatterNDBase(const Output< Node > &inputs, const Output< Node > &indices, const Output< Node > &updates)
Constructs ScatterNDBase object.
ngraph::op::util::ScatterNDBase
Base class for ScatterNDXXX operators.
Definition: scatter_nd_base.hpp:31
ngraph::op::util::ScatterNDBase::validate_and_infer_types
virtual void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::AttributeVisitor
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:70
ngraph::op::util::ScatterNDBase::get_type_info
const NodeTypeInfo & get_type_info() const override
Definition: scatter_nd_base.hpp:34
ngraph::op::Op
Root of all actual ops.
Definition: op.hpp:29