scatter_nd_update.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 #include "ngraph/op/util/scatter_nd_base.hpp"
21 
22 namespace ngraph
23 {
24  namespace op
25  {
26  namespace v3
27  {
28  /// \brief Add updates to slices from inputs addressed by indices
29  class NGRAPH_API ScatterNDUpdate : public util::ScatterNDBase
30  {
31  public:
32  static constexpr NodeTypeInfo type_info{"ScatterNDUpdate", 3};
33  const NodeTypeInfo& get_type_info() const override { return type_info; }
34  ScatterNDUpdate() = default;
35  /// \param inputs Tensor
36  /// \param indices Index tensor: Data type must be `element::i32` or `element::i64`
37  /// \param updates Tensor: Must have same type as inputs
38  ScatterNDUpdate(const Output<Node>& inputs,
39  const Output<Node>& indices,
40  const Output<Node>& updates)
41  : util::ScatterNDBase(inputs, indices, updates)
42  {
43  }
44 
45  virtual std::shared_ptr<Node>
46  clone_with_new_inputs(const OutputVector& new_args) const override;
47  };
48  }
49  using v3::ScatterNDUpdate;
50  }
51 }
ngraph::op::util::ScatterNDBase
Base class for ScatterNDXXX operators.
Definition: scatter_nd_base.hpp:31
ngraph::op::v3::ScatterNDUpdate
Add updates to slices from inputs addressed by indices.
Definition: scatter_nd_update.hpp:30
ngraph::op::v3::ScatterNDUpdate::get_type_info
const NodeTypeInfo & get_type_info() const override
Definition: scatter_nd_update.hpp:33
ngraph::op::v3::ScatterNDUpdate::ScatterNDUpdate
ScatterNDUpdate(const Output< Node > &inputs, const Output< Node > &indices, const Output< Node > &updates)
Definition: scatter_nd_update.hpp:38
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28