1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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 //*****************************************************************************
19 #include "ngraph/op/op.hpp"
27 class NGRAPH_DEPRECATED(
28 "This operation is deprecated and will be removed soon. Please do not use it.")
29 NGRAPH_API QuantizedDot : public Op
31 NGRAPH_SUPPRESS_DEPRECATED_START
33 static constexpr NodeTypeInfo type_info{"QuantizedDot", 0};
34 const NodeTypeInfo& get_type_info() const override { return type_info; }
35 QuantizedDot() = default;
36 /// \brief Constructs a quantized convolution operation.
38 /// \param input0 The node producing the input data batch tensor.
39 /// \param input1 The node producing the filters tensor.
40 /// \param input0_scale Scale to transform the input
41 /// \param input0_zero_point Zero point used for mapping
42 /// \param input1_scale Scale to transform the filters
43 /// \param input1_zero_point Zero point used for mapping
44 /// \param output_scale Scale to transform the output
45 /// \param output_zero_point Zero point used for mapping
46 /// \param output_type Output element type
47 /// \param input0_axes Input0 axes set for channel wise quantization
48 /// \param input1_axes Input1 axes set for channel wise quantization
49 /// \param output_axes Output axes set for channel wise quantization
50 QuantizedDot(const Output<Node>& input0,
51 const Output<Node>& input1,
52 size_t reduction_axes_count,
53 const Output<Node>& input0_scale,
54 const Output<Node>& input0_zero_point,
55 const Output<Node>& input1_scale,
56 const Output<Node>& input1_zero_point,
57 const Output<Node>& output_scale,
58 const Output<Node>& output_zero_point,
59 const element::Type& output_type,
60 const AxisSet& input0_axes = ngraph::AxisSet{},
61 const AxisSet& input1_axes = ngraph::AxisSet{},
62 const AxisSet& output_axes = ngraph::AxisSet{});
64 std::shared_ptr<Node> get_input0() { return input_value(0).get_node_shared_ptr(); }
65 std::shared_ptr<Node> get_input1() { return input_value(1).get_node_shared_ptr(); }
66 const ngraph::element::Type& get_output_type() const { return m_output_type; }
67 const ngraph::AxisSet& get_input0_axes() const { return m_input0_axes; }
68 const ngraph::AxisSet& get_input1_axes() const { return m_input1_axes; }
69 const ngraph::AxisSet& get_output_axes() const { return m_output_axes; }
70 size_t get_reduction_axes_count() const { return m_reduction_axes_count; }
71 void set_reduction_axes_count(size_t reduction_axes_count)
73 m_reduction_axes_count = reduction_axes_count;
75 void validate_and_infer_types() override;
76 virtual std::shared_ptr<Node>
77 clone_with_new_inputs(const OutputVector& new_args) const override;
80 size_t m_reduction_axes_count;
81 bool m_has_reduction_axes_count;
82 ngraph::element::Type m_output_type;
83 ngraph::AxisSet m_input0_axes;
84 ngraph::AxisSet m_input1_axes;
85 ngraph::AxisSet m_output_axes;
86 NGRAPH_SUPPRESS_DEPRECATED_END
89 NGRAPH_SUPPRESS_DEPRECATED_START
90 using v0::QuantizedDot;
91 NGRAPH_SUPPRESS_DEPRECATED_END