44
55#pragma once
66
7- #include " openvino/op/op.hpp"
8- #include " openvino/op/util/attr_types.hpp"
7+ #include " openvino/op/util/avg_pool_base.hpp"
98
109namespace ov {
1110namespace op {
1211namespace v1 {
1312// / \brief Batched average pooling operation.
14- // /
15- class OPENVINO_API AvgPool : public Op {
13+ // / \ingroup ov_ops_cpp_api
14+ class OPENVINO_API AvgPool : public util::AvgPoolBase {
1615public:
17- OPENVINO_OP (" AvgPool" , " opset1" , op::Op );
16+ OPENVINO_OP (" AvgPool" , " opset1" , util::AvgPoolBase );
1817
1918 // / \brief Constructs a batched average pooling operation.
2019 AvgPool () = default ;
2120
22- // /
2321 // / \brief Constructs a batched average pooling operation.
2422 // /
2523 // / \param arg The output producing the input data batch tensor.<br>
@@ -35,63 +33,31 @@ class OPENVINO_API AvgPool : public Op {
3533 // / \param rounding_type Whether to use ceiling or floor rounding type while
3634 // / computing output shape.
3735 // / \param auto_pad Padding type to use for additional padded dimensions
38- // /
3936 AvgPool (const Output<Node>& arg,
4037 const Strides& strides,
4138 const Shape& pads_begin,
4239 const Shape& pads_end,
4340 const Shape& kernel,
4441 bool exclude_pad,
45- op:: RoundingType rounding_type = op:: RoundingType::FLOOR,
46- const PadType& auto_pad = op:: PadType::EXPLICIT);
42+ RoundingType rounding_type = RoundingType::FLOOR,
43+ const PadType& auto_pad = PadType::EXPLICIT);
4744
4845 void validate_and_infer_types () override ;
49- bool visit_attributes (AttributeVisitor& visitor) override ;
5046
5147 std::shared_ptr<Node> clone_with_new_inputs (const OutputVector& new_args) const override ;
52-
53- // / \return The kernel shape.
54- const Shape& get_kernel () const ;
55- void set_kernel (const Shape& kernel);
56- // / \return The strides.
57- const Strides& get_strides () const ;
58- void set_strides (const Strides& strides);
59- // / \return The beginning of padding shape.
60- const Shape& get_pads_begin () const ;
61- void set_pads_begin (const Shape& pads_begin);
62- // / \return The end of padding shape.
63- const Shape& get_pads_end () const ;
64- void set_pads_end (const Shape& pads_end);
65- bool get_exclude_pad () const ;
66- void set_exclude_pad (bool exclude_pad);
67- // / \return The pad type for pooling.
68- const PadType& get_auto_pad () const ;
69- void set_auto_pad (const PadType& auto_pad);
70- op::RoundingType get_rounding_type () const ;
71- void set_rounding_type (op::RoundingType rounding_type);
72-
73- protected:
74- Shape m_kernel;
75- Strides m_strides;
76- Shape m_pads_begin;
77- Shape m_pads_end;
78- bool m_exclude_pad{true };
79- PadType m_auto_pad{PadType::EXPLICIT};
80- op::RoundingType m_rounding_type{op::RoundingType::FLOOR};
8148};
8249} // namespace v1
8350
8451namespace v14 {
8552// / \brief Batched average pooling operation.
86- // /
87- class OPENVINO_API AvgPool : public Op {
53+ // / \ingroup ov_ops_cpp_api
54+ class OPENVINO_API AvgPool : public util::AvgPoolBase {
8855public:
89- OPENVINO_OP (" AvgPool" , " opset14" , op::Op );
56+ OPENVINO_OP (" AvgPool" , " opset14" , util::AvgPoolBase );
9057
9158 // / \brief Constructs a batched average pooling operation.
9259 AvgPool () = default ;
9360
94- // /
9561 // / \brief Constructs a batched average pooling operation.
9662 // /
9763 // / \param arg The output producing the input data batch tensor.<br>
@@ -107,49 +73,18 @@ class OPENVINO_API AvgPool : public Op {
10773 // / \param rounding_type Whether to use ceiling or floor rounding type while
10874 // / computing output shape.
10975 // / \param auto_pad Padding type to use for additional padded dimensions
110- // /
11176 AvgPool (const Output<Node>& arg,
11277 const Strides& strides,
11378 const Shape& pads_begin,
11479 const Shape& pads_end,
11580 const Shape& kernel,
11681 bool exclude_pad,
117- op:: RoundingType rounding_type = op:: RoundingType::FLOOR,
118- const PadType& auto_pad = op:: PadType::EXPLICIT);
82+ RoundingType rounding_type = RoundingType::FLOOR,
83+ const PadType& auto_pad = PadType::EXPLICIT);
11984
12085 void validate_and_infer_types () override ;
121- bool visit_attributes (AttributeVisitor& visitor) override ;
12286
12387 std::shared_ptr<Node> clone_with_new_inputs (const OutputVector& new_args) const override ;
124-
125- // / \return The kernel shape.
126- const Shape& get_kernel () const ;
127- void set_kernel (const Shape& kernel);
128- // / \return The strides.
129- const Strides& get_strides () const ;
130- void set_strides (const Strides& strides);
131- // / \return The beginning of padding shape.
132- const Shape& get_pads_begin () const ;
133- void set_pads_begin (const Shape& pads_begin);
134- // / \return The end of padding shape.
135- const Shape& get_pads_end () const ;
136- void set_pads_end (const Shape& pads_end);
137- bool get_exclude_pad () const ;
138- void set_exclude_pad (bool exclude_pad);
139- // / \return The pad type for pooling.
140- const PadType& get_auto_pad () const ;
141- void set_auto_pad (const PadType& auto_pad);
142- op::RoundingType get_rounding_type () const ;
143- void set_rounding_type (op::RoundingType rounding_type);
144-
145- protected:
146- Shape m_kernel;
147- Strides m_strides;
148- Shape m_pads_begin;
149- Shape m_pads_end;
150- bool m_exclude_pad{true };
151- PadType m_auto_pad{PadType::EXPLICIT};
152- op::RoundingType m_rounding_type{op::RoundingType::FLOOR};
15388};
15489} // namespace v14
15590} // namespace op
0 commit comments