Skip to content

Commit

Permalink
[core] Drop legacy shape infer from validation utils (openvinotoolkit…
Browse files Browse the repository at this point in the history
…#22036)

* Drop from validation_utils:
- try_apply_auto_padding
- infer_auto_padding

* Drop from validation_utils
- infer_convolution_forward
- validate_and_infer_convolution_forward_output_shape
  • Loading branch information
praasz authored Jan 24, 2024
1 parent e5ca6a3 commit 8321a41
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 487 deletions.
46 changes: 0 additions & 46 deletions src/core/dev_api/validation_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,6 @@ Tensor make_tensor_of_max_value(const element::Type_t et);
/// \return Tensor with minimum value.
Tensor make_tensor_of_min_value(const element::Type_t et);

/// \brief Apply auto padding to padding_above and padding_below inputs
/// if all needed informations are known.
///
/// \param image_shape The shape of input image.
/// \param filter_shape The shape of filter input.
/// \param filter_strides The strides of applied padding.
/// \param filter_dilations The dilations of applied padding.
/// \param pad_type The type of padding. Auto padding is applied only
/// for SAME_UPPER and SAME_LOWER mode.
/// \param padding_above The beginning of padding shape.
/// \param end The beginning of padding shape.
///
/// \return true if auto padding was applied successfully (all needed informations such as
/// spatial dims are known), false otherwise.
OPENVINO_DEPRECATED("This function is deprecated and will be removed.")
OPENVINO_API bool try_apply_auto_padding(const PartialShape& image_shape,
const Shape& filter_shape,
const Strides& filter_strides,
const Strides& filter_dilations,
const op::PadType pad_type,
CoordinateDiff& padding_above,
CoordinateDiff& padding_below);

/// @brief Get the tensors shapes as ov::PartialShape.
///
/// @param tensors Input tensors vector to get their shapes.
Expand All @@ -107,29 +84,6 @@ OPENVINO_API std::vector<PartialShape> get_node_input_partial_shapes(const ov::N
/// \return True if rank compatible to any of others, otherwise false.
OPENVINO_API bool is_rank_compatible_any_of(const Rank& r, std::initializer_list<Rank> others);

/// \brief Infers the output batch shape for convolution forward propagation.
///
/// \return Infered output shape.
OPENVINO_DEPRECATED("This function is deprecated and will be removed.")
OPENVINO_API PartialShape infer_convolution_forward(const Node* node,
const PartialShape& data_batch_shape,
const Strides& data_dilation,
const CoordinateDiff& data_padding_below,
const CoordinateDiff& data_padding_above,
const PartialShape& filters_shape,
const Strides& filter_strides,
const Strides& filter_dilation);

/// \brief Infers image paddings.
OPENVINO_DEPRECATED("This function is deprecated and will be removed.")
OPENVINO_API void infer_auto_padding(const Shape& image_shape,
const Shape& filter_shape,
const Strides& filter_strides,
const Strides& filter_dilations,
const op::PadType pad_type,
CoordinateDiff& padding_above,
CoordinateDiff& padding_below);

/// \brief Evaluates lower and upper value estimations for the output tensor. Estimation would be represented as partial
/// shape object using Dimension(min, max) for each element.
///
Expand Down
49 changes: 0 additions & 49 deletions src/core/include/ngraph/validation_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace ngraph {
using ov::evaluate_as_partial_shape;
using ov::get_constant_from_source;
using ov::has_no_labels;
using ov::infer_auto_padding;
using ov::infer_convolution_forward;
using ov::normalize_axes;
using ov::normalize_axis;
using ov::op::v0::Constant;
Expand Down Expand Up @@ -63,29 +61,6 @@ void validate_conv_params_spatial_dimensions(const Node* node,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end);

/// \brief Validates input shape ranks and infers convolution forward output shape.
///
/// \param[in] node Node with convolution operation.
/// \param[in] data_batch_pshape Partial shape of data batch input.
/// \param[in] filters_pshape Partial shape of filters input.
/// \param[in] auto_pad Type of padding.
/// \param strides Strides.
/// \param dilations Dilations.
/// \param pads_begin Pads begin.
/// \param pads_end Pads end.
///
/// \return Partial shape of the output.
NGRAPH_API_DEPRECATED
PartialShape validate_and_infer_convolution_forward_output_shape(const Node* node,
const Rank& result_ps_rank,
const PartialShape& data_batch_pshape,
const PartialShape& filters_pshape,
const op::PadType auto_pad,
Strides& strides,
Strides& dilations,
CoordinateDiff& pads_begin,
CoordinateDiff& pads_end);

NGRAPH_API_DEPRECATED
NGRAPH_API
PartialShape infer_batched_pooling_forward(const Node* node,
Expand Down Expand Up @@ -122,30 +97,6 @@ std::tuple<element::Type, PartialShape, PartialShape> infer_batch_norm_forward(c
const PartialShape& gamma_shape,
const PartialShape& beta_shape);

/// \brief Apply auto padding to padding_above and padding_below inputs
/// if all needed informations are known.
///
/// \param image_shape The shape of input image.
/// \param filter_shape The shape of filter input.
/// \param filter_strides The strides of applied padding.
/// \param filter_dilations The dilations of applied padding.
/// \param pad_type The type of padding. Auto padding is applied only
/// for SAME_UPPER and SAME_LOWER mode.
/// \param padding_above The beginning of padding shape.
/// \param end The beginning of padding shape.
///
/// \return true if auto padding was applied successfully (all needed informations such as
/// spatial dims are known), false otherwise.
NGRAPH_API_DEPRECATED
NGRAPH_API
bool try_apply_auto_padding(const PartialShape& image_shape,
const Shape& filter_shape,
const Strides& filter_strides,
const Strides& filter_dilations,
const op::PadType pad_type,
CoordinateDiff& padding_above,
CoordinateDiff& padding_below);

NGRAPH_API_DEPRECATED
NGRAPH_API
PartialShape infer_slice_shape(const Node* node,
Expand Down
21 changes: 0 additions & 21 deletions src/core/include/openvino/core/validation_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@

namespace ov {

OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.")
OPENVINO_API
PartialShape infer_convolution_forward(const Node* node,
const PartialShape& data_batch_shape,
const Strides& data_dilation,
const CoordinateDiff& data_padding_below,
const CoordinateDiff& data_padding_above,
const PartialShape& filters_shape,
const Strides& filter_strides,
const Strides& filter_dilation);

OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.")
OPENVINO_API
void infer_auto_padding(const Shape& image_shape,
const Shape& filter_shape,
const Strides& filter_strides,
const Strides& filter_dilations,
const op::PadType pad_type,
CoordinateDiff& padding_above,
CoordinateDiff& padding_below);

/// \brief Handle out of range axis.
///
/// \param[in] node The node with requested axis.
Expand Down
Loading

0 comments on commit 8321a41

Please sign in to comment.