scatter_elements_update.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/axis_vector.hpp"
8 #include "ngraph/node.hpp"
9 #include "ngraph/op/op.hpp"
10 #include "ngraph/runtime/aligned_buffer.hpp"
11 #include "ngraph/runtime/host_tensor.hpp"
12 
13 namespace ngraph
14 {
15  namespace op
16  {
17  namespace v3
18  {
19  class NGRAPH_API ScatterElementsUpdate : public Op
20  {
21  public:
22  static constexpr NodeTypeInfo type_info{"ScatterElementsUpdate", 3};
23  const NodeTypeInfo& get_type_info() const override { return type_info; }
24  ScatterElementsUpdate() = default;
25  /// \brief Constructs a ScatterElementsUpdate node
26 
27  /// \param data Input data
28  /// \param indices Data entry index that will be updated
29  /// \param updates Update values
30  /// \param axis Axis to scatter on
32  const Output<Node>& indices,
33  const Output<Node>& updates,
34  const Output<Node>& axis);
35 
36  virtual void validate_and_infer_types() override;
37  virtual bool visit_attributes(AttributeVisitor& visitor) override;
38 
39  virtual std::shared_ptr<Node>
40  clone_with_new_inputs(const OutputVector& inputs) const override;
41  bool evaluate(const HostTensorVector& outputs,
42  const HostTensorVector& inputs) const override;
43  bool has_evaluate() const override;
44 
45  private:
46  bool evaluate_scatter_element_update(const HostTensorVector& outputs,
47  const HostTensorVector& inputs) const;
48  };
49  } // namespace v3
51  } // namespace op
52 } // 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
Definition: scatter_elements_update.hpp:20
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_elements_update.hpp:23
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
ScatterElementsUpdate(const Output< Node > &data, const Output< Node > &indices, const Output< Node > &updates, const Output< Node > &axis)
Constructs a ScatterElementsUpdate node.
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27