namespace ov::op::convolution¶
Overview¶
namespace convolution {
// namespaces
namespace ov::op::convolution::validate;
// global variables
constexpr auto num_spatial_undefined = util::num_spatial_undefined;
constexpr size_t spatial_dim_offset = 2;
// global functions
template <
class TOp,
class TShape,
typename std::enable_if<std::is_base_of<util::ConvolutionBackPropBase, TOp>::value>::type \* = nullptr
>
size_t calculate_num_spatial(
const TOp \* op,
const std::vector<TShape>& input_shapes,
const TShape& out_spatial_shape
);
template <class TOp, class TShape, class TIter>
void apply_auto_pad(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
const TShape& out_spatial_shape,
TIter pads_begin,
TIter pads_end
);
template <class TShape>
void apply_padding(
const util::ConvolutionBackPropBase \* op,
const std::vector<TShape>& input_shapes,
const TShape& out_spatial_shape,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end
);
template <
class TOp,
class TShape,
class TContainer,
typename std::enable_if<std::is_base_of<ov::op::util::ConvolutionBackPropBase, TOp>::value>::type \* = nullptr
>
void append_spatial_shape(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
const TContainer& pads_begin,
const TContainer& pads_end,
TShape& out_shape
);
template <class TConv>
constexpr size_t filter_non_spatial_dims_count();
template <class TOp>
bool is_auto_pad(const TOp \* op);
void resize_empty_padding(
const size_t num_spatial,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end
);
size_t num_spatial_from_attr(const util::ConvolutionBase \* op);
template <
class TOp,
class TShape,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value>::type \* = nullptr
>
size_t calculate_num_spatial(
const TOp \* op,
const std::vector<TShape>& input_shapes
);
template <
class TOp,
class TShape,
class TIter,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value||std::is_base_of<util::DeformableConvolutionBase, TOp>::value>::type \* = nullptr
>
void apply_auto_pad(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
TIter pads_begin,
TIter pads_end
);
template <
class TOp,
class TShape,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value||std::is_base_of<util::DeformableConvolutionBase, TOp>::value>::type \* = nullptr
>
void apply_padding(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end
);
template <
class TOp,
class TShape,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value||std::is_base_of<util::DeformableConvolutionBase, TOp>::value>::type \* = nullptr
>
void append_spatial_shape(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end,
TShape& out_shape
);
constexpr size_t filter_non_spatial_dims_count< v1::GroupConvolutionBackpropData >();
constexpr size_t filter_non_spatial_dims_count< v1::GroupConvolution >();
} // namespace convolution
Detailed Documentation¶
Global Functions¶
template <class TOp, class TShape, class TIter>
void apply_auto_pad(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
const TShape& out_spatial_shape,
TIter pads_begin,
TIter pads_end
)
Apply auto padding for backward convolution.
The auto padding can be applied only if inputs and attributes of operator are validated. The input shapes must have got static ranks.
Parameters:
op |
Pointer to convolution operator. |
data_shape |
Input data shape (must be static rank). |
filters_shape |
Input filter shape (must be static rank). |
out_spatial_shape |
Reference to input with out spatial shape. |
pads_begin |
Iterator to begin of pads begin. |
pads_end |
Iterator to begin of pads end. |
template <class TShape>
void apply_padding(
const util::ConvolutionBackPropBase \* op,
const std::vector<TShape>& input_shapes,
const TShape& out_spatial_shape,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end
)
Apply auto padding for back propagation convolutions.
Parameters:
TShape |
Shape type. |
op |
Pointer to back propagation convolution operator. |
data_shape |
Input data shape. |
filters_shape |
Input filter shape. |
out_spatial_shape |
Input output spatial shape. |
template <
class TOp,
class TShape,
class TContainer,
typename std::enable_if<std::is_base_of<ov::op::util::ConvolutionBackPropBase, TOp>::value>::type \* = nullptr
>
void append_spatial_shape(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
const TContainer& pads_begin,
const TContainer& pads_end,
TShape& out_shape
)
Append spatial dimension at end of output shape of back propagation convolution.
Parameters:
TOp |
Back propagation convolution operator type. |
TShape |
Type of shape. |
op |
Pointer to operator. |
data_shape |
Input data shape. |
filters_shape |
Input filter shape. |
out_shape |
Output shape to append spatial dimensions. |
template <class TConv>
constexpr size_t filter_non_spatial_dims_count()
Provides convolution filter non spatial dimension count.
If specific convolution operator requires different value provide specialization for this operator.
Parameters:
TConv |
Type of convolution operator. |
Returns:
Default value for convolution operators (2).
template <class TOp>
bool is_auto_pad(const TOp \* op)
Checks if Op property auto_pad is set to same lower or upper.
Parameters:
TOp |
Type of operator (must have get_auto_pad member function). |
op |
Pointer to operator. |
Returns:
True if auto pad enabled.
void resize_empty_padding(
const size_t num_spatial,
CoordinateDiff& pads_begin,
CoordinateDiff& 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 TIter,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value||std::is_base_of<util::DeformableConvolutionBase, TOp>::value>::type \* = nullptr
>
void apply_auto_pad(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
TIter pads_begin,
TIter pads_end
)
Apply auto padding for forward convolution.
The auto padding can be applied only if inputs and attributes of operator are validated. The input shapes must have got static ranks.
Parameters:
op |
Pointer to convolution operator. |
data_shape |
Input data shape (must be static rank). |
filters_shape |
Input filter shape (must be static rank). |
pads_begin |
Iterator to begin of pads begin. |
pads_end |
Iterator to begin of pads end. |
template <
class TOp,
class TShape,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value||std::is_base_of<util::DeformableConvolutionBase, TOp>::value>::type \* = nullptr
>
void apply_padding(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end
)
Apply padding to forward propagation convolution besed on padding.
Parameters:
TShape |
|
op |
Pointer to coevolution operator. |
data_shape |
Input data shapes for shape inference. |
filters_shape |
Input filters shape for shape inference. |
pads_begin |
Begin padding to updated. |
pads_end |
End padding to update. |
template <
class TOp,
class TShape,
typename std::enable_if<std::is_base_of<util::ConvolutionFwdPropBase, TOp>::value||std::is_base_of<util::DeformableConvolutionBase, TOp>::value>::type \* = nullptr
>
void append_spatial_shape(
const TOp \* op,
const TShape& data_shape,
const TShape& filters_shape,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end,
TShape& out_shape
)
Append spatial dimension at end of output shape of forward propagation convolution.
Parameters:
TOp |
Forward propagation convolution operator type. |
TShape |
Type of shape. |
op |
Pointer to operator. |
data_shape |
Input data shape. |
filters_shape |
Input filter shape. |
out_shape |
Output shape to append spatial dimensions. |
constexpr size_t filter_non_spatial_dims_count< v1::GroupConvolutionBackpropData >()
Defines non-spatial dimension for filters for group convolution back propagation operator.
Returns:
Value of non-spatial filter dimensions (3).
constexpr size_t filter_non_spatial_dims_count< v1::GroupConvolution >()
Defines non-spatial dimension for filters for group convolution operator.
Returns:
Value of non-spatial filter dimensions (3).