4
4
5
5
#pragma once
6
6
7
- #include " openvino/op/op.hpp"
8
- #include " openvino/op/util/attr_types.hpp"
7
+ #include " openvino/op/util/avg_pool_base.hpp"
9
8
10
9
namespace ov {
11
10
namespace op {
12
11
namespace v1 {
13
12
// / \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 {
16
15
public:
17
- OPENVINO_OP (" AvgPool" , " opset1" , op::Op );
16
+ OPENVINO_OP (" AvgPool" , " opset1" , util::AvgPoolBase );
18
17
19
18
// / \brief Constructs a batched average pooling operation.
20
19
AvgPool () = default ;
21
20
22
- // /
23
21
// / \brief Constructs a batched average pooling operation.
24
22
// /
25
23
// / \param arg The output producing the input data batch tensor.<br>
@@ -35,63 +33,31 @@ class OPENVINO_API AvgPool : public Op {
35
33
// / \param rounding_type Whether to use ceiling or floor rounding type while
36
34
// / computing output shape.
37
35
// / \param auto_pad Padding type to use for additional padded dimensions
38
- // /
39
36
AvgPool (const Output<Node>& arg,
40
37
const Strides& strides,
41
38
const Shape& pads_begin,
42
39
const Shape& pads_end,
43
40
const Shape& kernel,
44
41
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);
47
44
48
45
void validate_and_infer_types () override ;
49
- bool visit_attributes (AttributeVisitor& visitor) override ;
50
46
51
47
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};
81
48
};
82
49
} // namespace v1
83
50
84
51
namespace v14 {
85
52
// / \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 {
88
55
public:
89
- OPENVINO_OP (" AvgPool" , " opset14" , op::Op );
56
+ OPENVINO_OP (" AvgPool" , " opset14" , util::AvgPoolBase );
90
57
91
58
// / \brief Constructs a batched average pooling operation.
92
59
AvgPool () = default ;
93
60
94
- // /
95
61
// / \brief Constructs a batched average pooling operation.
96
62
// /
97
63
// / \param arg The output producing the input data batch tensor.<br>
@@ -107,49 +73,18 @@ class OPENVINO_API AvgPool : public Op {
107
73
// / \param rounding_type Whether to use ceiling or floor rounding type while
108
74
// / computing output shape.
109
75
// / \param auto_pad Padding type to use for additional padded dimensions
110
- // /
111
76
AvgPool (const Output<Node>& arg,
112
77
const Strides& strides,
113
78
const Shape& pads_begin,
114
79
const Shape& pads_end,
115
80
const Shape& kernel,
116
81
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);
119
84
120
85
void validate_and_infer_types () override ;
121
- bool visit_attributes (AttributeVisitor& visitor) override ;
122
86
123
87
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};
153
88
};
154
89
} // namespace v14
155
90
} // namespace op
0 commit comments