hsigmoid.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/node.hpp"
20 #include "ngraph/op/op.hpp"
21 #include "ngraph/op/util/unary_elementwise_arithmetic.hpp"
22 
23 namespace ngraph
24 {
25  namespace op
26  {
27  namespace v5
28  {
29  /// \brief A HSigmoid Activation Function
30  /// f(x) = min(max(x + 3, 0), 6) / 6 or
31  /// f(x) = min(ReLU(x + 3), 6) / 6
32  ///
34  {
35  public:
36  NGRAPH_RTTI_DECLARATION;
37  HSigmoid() = default;
38 
39  /// \brief Constructs a HSigmoid operation.
40  ///
41  /// \param data Input tensor
42  HSigmoid(const Output<Node>& arg);
43 
44  bool visit_attributes(AttributeVisitor& visitor) override;
45 
46  virtual std::shared_ptr<Node>
47  clone_with_new_inputs(const OutputVector& new_args) const override;
48  bool evaluate(const HostTensorVector& outputs,
49  const HostTensorVector& inputs) const override;
50  };
51  }
52  }
53 }
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:71
A handle for one of a node's outputs.
Definition: node_output.hpp:42
Abstract base class for elementwise unary arithmetic operations, i.e., operations where the same scal...
Definition: unary_elementwise_arithmetic.hpp:49
A HSigmoid Activation Function f(x) = min(max(x + 3, 0), 6) / 6 or f(x) = min(ReLU(x + 3),...
Definition: hsigmoid.hpp:34
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
HSigmoid(const Output< Node > &arg)
Constructs a HSigmoid operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28