namespace ov::op::pooling¶
Overview¶
namespace pooling {
// namespaces
namespace ov::op::pooling::validate;
// global variables
constexpr size_t spatial_dim_offset = 2;
// global functions
void valid_dilated_kernel_with_padding(
const v1::AvgPool \* op,
const size_t kernel,
const size_t pad_begin,
const size_t pad_end,
const size_t axis
);
template <class TContainer>
void resize_empty_padding(
const size_t num_spatial,
TContainer& pads_begin,
TContainer& pads_end
);
template <class TOp, class TShape, class TContainer>
void apply_padding(
const TOp \* op,
const TShape& data_shape,
const Strides& dilations,
TContainer& pads_begin,
TContainer& pads_end
);
template <class TOp, class TDim>
void valid_dilated_kernel_with_dim(
const TOp \* op,
const size_t kernel,
const TDim& dim,
const size_t axis
);
template <class TOp>
void valid_dilated_kernel_with_padding(
const TOp \* op,
const size_t kernel,
const size_t pad_begin,
const size_t pad_end,
const size_t axis
);
template <class TOp, class TShape, class TContainer>
void append_spatial_shape(
const TOp \* op,
const TShape& data_shape,
const TContainer& pads_begin,
const TContainer& pads_end,
const Strides& dilations,
TShape& out_shape
);
template <class TOp, class TShape, class TContainer>
TShape out_shape_infer(
const TOp \* op,
const TShape& data_shape,
const TContainer& pads_begin,
const TContainer& pads_end,
const Strides& dilations
);
template <
class TShape,
class TOp,
typename std::enable_if<std::is_same<TOp, v8::AdaptiveAvgPool>::value||std::is_same<TOp, v8::AdaptiveMaxPool>::value>::type \* = nullptr
>
TShape out_shape_infer(
const TOp \* op,
const std::vector<TShape>& input_shapes,
const std::map<size_t, HostTensorPtr>& constant_data = {}
);
} // namespace pooling
Detailed Documentation¶
Global Functions¶
template <class TContainer>
void resize_empty_padding(
const size_t num_spatial,
TContainer& pads_begin,
TContainer& pads_end
)
Resize paddings if empty to number of spatial dimensions.
Parameters:
num_spatial |
Number of spatial dimensions. |
pads_begin |
Begin padding to resize. |
pads_end |
End padding to resize. |
template <class TOp, class TShape, class TContainer>
void apply_padding(
const TOp \* op,
const TShape& data_shape,
const Strides& dilations,
TContainer& pads_begin,
TContainer& pads_end
)
Apply pooling operator padding depends on auto pad value.
Parameters:
op |
Pointer to Pooling operator to apply padding. |
data_shape |
Shape infer data input shape. |
dilations |
Kernel dilations. |
pads_begin |
Padding begin to update. |
pads_end |
Padding end to update. |
template <class TOp, class TShape, class TContainer>
void append_spatial_shape(
const TOp \* op,
const TShape& data_shape,
const TContainer& pads_begin,
const TContainer& pads_end,
const Strides& dilations,
TShape& out_shape
)
Append spatial shape to the end of output shape for pooling operator shape inference result.
Parameters:
op |
Pointer to pooling operator. |
data_shape |
Shape inference input pooling data shape. |
pads_begin |
Pooling pads begin. |
pads_end |
Pooling pads end. |
dilations |
Kernel dilations. |
out_shape |
Output shape for appending the spatial shape of pooling |
template <class TOp, class TShape, class TContainer>
TShape out_shape_infer(
const TOp \* op,
const TShape& data_shape,
const TContainer& pads_begin,
const TContainer& pads_end,
const Strides& dilations
)
Shape inference helper used for pooling operators such Max Pool, Avg Pool.
template <
class TShape,
class TOp,
typename std::enable_if<std::is_same<TOp, v8::AdaptiveAvgPool>::value||std::is_same<TOp, v8::AdaptiveMaxPool>::value>::type \* = nullptr
>
TShape out_shape_infer(
const TOp \* op,
const std::vector<TShape>& input_shapes,
const std::map<size_t, HostTensorPtr>& constant_data = {}
)
Shape inference helper used for adaptive pooling operators.