dequantization_attribute.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief Defines fused names attribute
7  * @file fused_names_attribute.hpp
8  */
9 
10 #include <assert.h>
11 #include <functional>
12 #include <memory>
13 #include <string>
14 #include <set>
15 
16 #include <ngraph/node.hpp>
17 #include <ngraph/variant.hpp>
18 #include <transformations_visibility.hpp>
19 
20 
21 namespace ngraph {
22 
23 /**
24  * @ingroup ie_runtime_attr_api
25  * @brief Dequantization class represents runtime info attribute that indicates
26  * whether the operation is dequantization
27  */
28 class TRANSFORMATIONS_API DequantizationAttr {
29 private:
30  std::string dequantization_attribute;
31 
32 public:
33  /**
34  * A default constructor
35  */
36  DequantizationAttr() = default;
37 
38  /**
39  * @brief Constructs a new object consisting of a single name *
40  * @param[in] name The name
41  */
42  explicit DequantizationAttr(const std::string& name) : dequantization_attribute(name) {}
43 
44  /**
45  * @brief return string with dequantization value
46  */
47  std::string getDequantizationAttr() const;
48 };
49 
50 extern template class TRANSFORMATIONS_API VariantImpl<DequantizationAttr>;
51 
52 template<>
53 class TRANSFORMATIONS_API VariantWrapper<DequantizationAttr> : public VariantImpl<DequantizationAttr> {
54 public:
55  static constexpr VariantTypeInfo type_info{"DEQUANTIZATION", 0};
56 
57  const VariantTypeInfo &get_type_info() const override {
58  return type_info;
59  }
60 
61  VariantWrapper(const value_type &value) : VariantImpl<value_type>(value) {}
62 
63  std::shared_ptr<ngraph::Variant> merge(const ngraph::NodeVector & nodes) override;
64 
65  std::shared_ptr<ngraph::Variant> init(const std::shared_ptr<ngraph::Node> & node) override;
66 };
67 
68 /**
69  * @ingroup ie_runtime_attr_api
70  * @brief getDequantization return string with dequantization value
71  * @param[in] node The node will be used to get Dequantization attribute
72  */
73 TRANSFORMATIONS_API std::string getDequantization(const std::shared_ptr<ngraph::Node>& node);
74 
75 } // namespace ngraph
Dequantization class represents runtime info attribute that indicates whether the operation is dequan...
Definition: dequantization_attribute.hpp:28
std::string getDequantizationAttr() const
return string with dequantization value
DequantizationAttr(const std::string &name)
Constructs a new object consisting of a single name *.
Definition: dequantization_attribute.hpp:42
Definition: dequantization_attribute.hpp:53
ngraph namespace
Definition: add_fake_quantize_fusion.hpp:14
std::string getDequantization(const std::shared_ptr< ngraph::Node > &node)
getDequantization return string with dequantization value