From c0fb4fabce0389870a5e6f1abd748e5c64b0a9e0 Mon Sep 17 00:00:00 2001 From: Pawel Raasz Date: Mon, 28 Aug 2023 22:03:35 +0200 Subject: [PATCH] [ShapeInfer] Remove old API from shape inference sources (#19435) * Remove old API from shape inference sources * Fix build issues --- .../shape_inference/include/broadcast_shape_inference.hpp | 8 +++----- .../include/embedding_segments_sum_shape_inference.hpp | 1 - .../include/grid_sample_shape_inference.hpp | 3 +-- .../shape_inference/include/one_hot_shape_inference.hpp | 6 +++--- src/core/shape_inference/include/utils.hpp | 4 ++-- src/core/src/op/ceiling.cpp | 1 + src/core/src/op/concat.cpp | 1 + src/core/src/op/squeeze.cpp | 1 + src/core/src/op/strided_slice.cpp | 1 + src/core/src/op/subtract.cpp | 1 + src/core/src/op/unsqueeze.cpp | 1 + src/core/src/op/util/gather_base.cpp | 2 ++ 12 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/core/shape_inference/include/broadcast_shape_inference.hpp b/src/core/shape_inference/include/broadcast_shape_inference.hpp index 1a0da2d0370..7bed67c8a72 100644 --- a/src/core/shape_inference/include/broadcast_shape_inference.hpp +++ b/src/core/shape_inference/include/broadcast_shape_inference.hpp @@ -3,12 +3,10 @@ // #pragma once -#include -#include -#include - -#include "ngraph/op/concat.hpp" #include "openvino/core/axis_vector.hpp" +#include "openvino/op/broadcast.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/util/broadcast_base.hpp" #include "utils.hpp" namespace ov { diff --git a/src/core/shape_inference/include/embedding_segments_sum_shape_inference.hpp b/src/core/shape_inference/include/embedding_segments_sum_shape_inference.hpp index f4aeec8164e..0acf534c7b4 100644 --- a/src/core/shape_inference/include/embedding_segments_sum_shape_inference.hpp +++ b/src/core/shape_inference/include/embedding_segments_sum_shape_inference.hpp @@ -16,7 +16,6 @@ template > std::vector shape_infer(const EmbeddingSegmentsSum* op, const std::vector& input_shapes, const ITensorAccessor& ta = make_tensor_accessor()) { - // const std::map>& constant_data = {}) { const auto input_size = input_shapes.size(); NODE_VALIDATION_CHECK(op, input_size >= 4 && input_size <= 6); diff --git a/src/core/shape_inference/include/grid_sample_shape_inference.hpp b/src/core/shape_inference/include/grid_sample_shape_inference.hpp index d799fd2f867..7fd85bf9afd 100644 --- a/src/core/shape_inference/include/grid_sample_shape_inference.hpp +++ b/src/core/shape_inference/include/grid_sample_shape_inference.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include #include +#include "openvino/op/grid_sample.hpp" #include "utils.hpp" namespace ov { diff --git a/src/core/shape_inference/include/one_hot_shape_inference.hpp b/src/core/shape_inference/include/one_hot_shape_inference.hpp index be68da4619d..5b2e9611ea3 100644 --- a/src/core/shape_inference/include/one_hot_shape_inference.hpp +++ b/src/core/shape_inference/include/one_hot_shape_inference.hpp @@ -49,15 +49,15 @@ std::vector shape_infer(const OneHot* op, const auto& off_value_shape = input_shapes[3]; NODE_VALIDATION_CHECK(op, - depth_shape.is_dynamic() || ngraph::is_scalar(depth_shape.to_shape()), + depth_shape.is_dynamic() || ov::is_scalar(depth_shape.to_shape()), "depth input must be scalar."); NODE_VALIDATION_CHECK(op, - on_value_shape.is_dynamic() || ngraph::is_scalar(on_value_shape.to_shape()), + on_value_shape.is_dynamic() || ov::is_scalar(on_value_shape.to_shape()), "on_value input must be scalar."); NODE_VALIDATION_CHECK(op, - off_value_shape.is_dynamic() || ngraph::is_scalar(off_value_shape.to_shape()), + off_value_shape.is_dynamic() || ov::is_scalar(off_value_shape.to_shape()), "off_value input must be scalar."); auto output_shapes = std::vector(1); diff --git a/src/core/shape_inference/include/utils.hpp b/src/core/shape_inference/include/utils.hpp index 6832cc58926..9d9fb0142a4 100644 --- a/src/core/shape_inference/include/utils.hpp +++ b/src/core/shape_inference/include/utils.hpp @@ -4,13 +4,13 @@ #pragma once #include -#include -#include #include #include "element_visitor.hpp" #include "openvino/core/bound_evaluation_util.hpp" #include "openvino/core/deprecated.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/opsets/opset1.hpp" #include "ov_optional.hpp" #include "shape_infer_type_utils.hpp" #include "tensor_data_accessor.hpp" diff --git a/src/core/src/op/ceiling.cpp b/src/core/src/op/ceiling.cpp index 699664a8f24..6bbc12d21cb 100644 --- a/src/core/src/op/ceiling.cpp +++ b/src/core/src/op/ceiling.cpp @@ -7,6 +7,7 @@ #include "itt.hpp" #include "ngraph/op/util/eval_copy.hpp" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/reference/ceiling.hpp" #include "openvino/reference/copy.hpp" diff --git a/src/core/src/op/concat.cpp b/src/core/src/op/concat.cpp index 1bbe4602115..d4966640c2a 100644 --- a/src/core/src/op/concat.cpp +++ b/src/core/src/op/concat.cpp @@ -10,6 +10,7 @@ #include "concat_shape_inference.hpp" #include "itt.hpp" #include "ngraph/attribute_visitor.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/core/dimension_tracker.hpp" #include "openvino/reference/concat.hpp" #include "validation_util.hpp" diff --git a/src/core/src/op/squeeze.cpp b/src/core/src/op/squeeze.cpp index 24c60610c02..195e306046e 100644 --- a/src/core/src/op/squeeze.cpp +++ b/src/core/src/op/squeeze.cpp @@ -12,6 +12,7 @@ #include "bound_evaluate.hpp" #include "itt.hpp" #include "ngraph/op/constant.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/reference/copy.hpp" #include "squeeze_shape_inference.hpp" diff --git a/src/core/src/op/strided_slice.cpp b/src/core/src/op/strided_slice.cpp index e020cb937df..5fe80b615be 100644 --- a/src/core/src/op/strided_slice.cpp +++ b/src/core/src/op/strided_slice.cpp @@ -17,6 +17,7 @@ #include "ngraph/slice_plan.hpp" #include "ngraph/type/element_type_traits.hpp" #include "ngraph/util.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/core/rt_info.hpp" #include "openvino/core/validation_util.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" diff --git a/src/core/src/op/subtract.cpp b/src/core/src/op/subtract.cpp index 966d94b31c6..57604264971 100644 --- a/src/core/src/op/subtract.cpp +++ b/src/core/src/op/subtract.cpp @@ -7,6 +7,7 @@ #include "itt.hpp" #include "ngraph/op/negative.hpp" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/reference/subtract.hpp" using namespace std; diff --git a/src/core/src/op/unsqueeze.cpp b/src/core/src/op/unsqueeze.cpp index e79fe09044a..c45900c4739 100644 --- a/src/core/src/op/unsqueeze.cpp +++ b/src/core/src/op/unsqueeze.cpp @@ -11,6 +11,7 @@ #include "bound_evaluate.hpp" #include "element_visitor.hpp" #include "itt.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/reference/copy.hpp" #include "unsqueeze_shape_inference.hpp" diff --git a/src/core/src/op/util/gather_base.cpp b/src/core/src/op/util/gather_base.cpp index 2d5f97bc220..acdbad1e8e5 100644 --- a/src/core/src/op/util/gather_base.cpp +++ b/src/core/src/op/util/gather_base.cpp @@ -7,6 +7,7 @@ #include "bound_evaluate.hpp" #include "gather_shape_inference.hpp" #include "itt.hpp" +#include "ngraph/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/squeeze.hpp" @@ -115,6 +116,7 @@ bool evaluate_gather(const ngraph::HostTensorPtr& arg0, int64_t batch_dims = 0) { bool rc = true; + using ov::element::Type_t; switch (out->get_element_type()) { NGRAPH_TYPE_CASE(evaluate_gather, i32, arg0, arg1, out, axis, batch_dims); NGRAPH_TYPE_CASE(evaluate_gather, i64, arg0, arg1, out, axis, batch_dims);