min.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/util/arithmetic_reduction.hpp"
20 #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp"
21 
22 namespace ngraph
23 {
24  namespace op
25  {
26  namespace v0
27  {
28  /// \brief Min-reduction operation.
29  class NGRAPH_DEPRECATED(
30  "This operation is deprecated and will be removed soon. "
31  "Use v1::ReduceMin instead of it.") NGRAPH_API Min
32  : public util::ArithmeticReduction
33  {
34  NGRAPH_SUPPRESS_DEPRECATED_START
35  public:
36  static constexpr NodeTypeInfo type_info{"Min", 0};
37 
38  const NodeTypeInfo& get_type_info() const override { return type_info; }
39  /// \brief Constructs a "min" reduction operation.
40  Min() = default;
41 
42  /// \brief Constructs a min-reduction operation.
43  ///
44  /// \param arg The tensor to be reduced.
45  /// \param reduction_axes The axis positions (0-based) to be eliminated.
46  Min(const Output<Node>& arg, const AxisSet& reduction_axes);
47 
48  /// \brief Constructs a "min" reduction operation.
49  ///
50  /// \param arg The tensor to be reduced.
51  /// \param reduction_axes The axis positions (0-based) to be eliminated.
52  Min(const Output<Node>& arg, const Output<Node>& reduction_axes);
53 
54  virtual std::shared_ptr<Node>
55  clone_with_new_inputs(const OutputVector& new_args) const override;
56 
57  /// \return The default value for Min.
58  virtual std::shared_ptr<Node> get_default_value() const override;
59 
60  bool evaluate(const HostTensorVector& outputs,
61  const HostTensorVector& inputs) const override;
62  NGRAPH_SUPPRESS_DEPRECATED_END
63  };
64  }
65 
66  namespace v1
67  {
68  class NGRAPH_API ReduceMin : public util::ArithmeticReductionKeepDims
69  {
70  public:
71  static constexpr NodeTypeInfo type_info{"ReduceMin", 1};
72  const NodeTypeInfo& get_type_info() const override { return type_info; }
73  /// \brief Constructs a summation operation.
74  ReduceMin() = default;
75  /// \brief Constructs a summation operation.
76  ///
77  /// \param arg The tensor to be summed.
78  /// \param reduction_axes The axis positions (0-based) to be eliminated.
79  /// \param keep_dims If set to 1 it holds axes that are used for reduction.
80  ReduceMin(const Output<Node>& arg,
81  const Output<Node>& reduction_axes,
82  bool keep_dims = false);
83 
84  virtual std::shared_ptr<Node>
85  clone_with_new_inputs(const OutputVector& new_args) const override;
86 
87  bool evaluate(const HostTensorVector& outputs,
88  const HostTensorVector& inputs) const override;
89  };
90  }
91 
92  NGRAPH_SUPPRESS_DEPRECATED_START
93  using v0::Min;
94  NGRAPH_SUPPRESS_DEPRECATED_END
95  }
96 }
ngraph::op::util::ArithmeticReductionKeepDims
Definition: arithmetic_reductions_keep_dims.hpp:29
ngraph::op::v1::ReduceMin::ReduceMin
ReduceMin(const Output< Node > &arg, const Output< Node > &reduction_axes, bool keep_dims=false)
Constructs a summation operation.
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::op::v1::ReduceMin::ReduceMin
ReduceMin()=default
Constructs a summation operation.
ngraph::op::v1::ReduceMin
Definition: min.hpp:69
ngraph::op::v1::ReduceMin::get_type_info
const NodeTypeInfo & get_type_info() const override
Definition: min.hpp:72