reduce_l2.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/util/arithmetic_reductions_keep_dims.hpp"
8 
9 namespace ngraph
10 {
11  namespace op
12  {
13  namespace v4
14  {
15  /// \brief Reduction operation using L2 norm:
16  ///
17  /// Reduces the tensor, eliminating the specified reduction axes by taking the L2-norm.
18  class NGRAPH_API ReduceL2 : public util::ArithmeticReductionKeepDims
19  {
20  public:
21  NGRAPH_RTTI_DECLARATION;
22  /// \brief Constructs a reducet L2-norm operation.
23  ReduceL2() = default;
24  /// \brief Constructs a reduce L2-norm operation.
25  ///
26  /// \param arg The tensor to be reduced.
27  /// \param reduction_axes The axis positions (0-based) to be eliminated.
28  /// \param keep_dims If set to true it holds axes that are used for reduction.
29  ReduceL2(const Output<Node>& arg,
30  const Output<Node>& reduction_axes,
31  bool keep_dims = false);
32 
33  size_t get_version() const override { return 4; }
34  /// \return The default value for Reduce.
35  virtual std::shared_ptr<Node> get_default_value() const override;
36 
37  virtual std::shared_ptr<Node>
38  clone_with_new_inputs(const OutputVector& new_args) const override;
39 
40  bool evaluate(const HostTensorVector& outputs,
41  const HostTensorVector& inputs) const override;
42  bool has_evaluate() const override;
43  };
44  } // namespace v4
45  } // namespace op
46 } // namespace ngraph
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Definition: arithmetic_reductions_keep_dims.hpp:17
Reduction operation using L2 norm:
Definition: reduce_l2.hpp:19
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
size_t get_version() const override
Definition: reduce_l2.hpp:33
virtual std::shared_ptr< Node > get_default_value() const override
ReduceL2(const Output< Node > &arg, const Output< Node > &reduction_axes, bool keep_dims=false)
Constructs a reduce L2-norm operation.
ReduceL2()=default
Constructs a reducet L2-norm operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16