minimum.hpp
1 //*****************************************************************************
2 // Copyright 2017-2021 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/binary_elementwise_arithmetic.hpp"
20 
21 namespace ngraph
22 {
23  namespace op
24  {
25  namespace v1
26  {
27  /// \brief Elementwise minimum operation.
28  class NGRAPH_API Minimum : public util::BinaryElementwiseArithmetic
29  {
30  public:
31  static constexpr NodeTypeInfo type_info{"Minimum", 1};
32  const NodeTypeInfo& get_type_info() const override { return type_info; }
33  /// \brief Constructs a minimum operation.
35  : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY)
36  {
37  }
38 
39  /// \brief Constructs a minimum operation.
40  ///
41  /// \param arg0 Node that produces the first input tensor.
42  /// \param arg1 Node that produces the second input tensor.
43  /// \param auto_broadcast Auto broadcast specification
44  Minimum(const Output<Node>& arg0,
45  const Output<Node>& arg1,
46  const AutoBroadcastSpec& auto_broadcast =
47  AutoBroadcastSpec(AutoBroadcastType::NUMPY));
48 
49  virtual std::shared_ptr<Node>
50  clone_with_new_inputs(const OutputVector& new_args) const override;
51 
52  bool evaluate(const HostTensorVector& outputs,
53  const HostTensorVector& inputs) const override;
54  };
55  } // namespace v1
56  }
57 }
A handle for one of a node's outputs.
Definition: node_output.hpp:42
Abstract base class for elementwise binary arithmetic operations, i.e., operations where the same sca...
Definition: binary_elementwise_arithmetic.hpp:55
Elementwise minimum operation.
Definition: minimum.hpp:29
Minimum()
Constructs a minimum operation.
Definition: minimum.hpp:34
Minimum(const Output< Node > &arg0, const Output< Node > &arg1, const AutoBroadcastSpec &auto_broadcast=AutoBroadcastSpec(AutoBroadcastType::NUMPY))
Constructs a minimum operation.
const NodeTypeInfo & get_type_info() const override
Definition: minimum.hpp:32
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:28
Definition: type.hpp:39
Implicit broadcast specification.
Definition: attr_types.hpp:323