From b9fd9c5665c998fea8786a2e9fee2776e667845c Mon Sep 17 00:00:00 2001 From: cao lei Date: Mon, 27 Nov 2023 13:41:12 -0800 Subject: [PATCH] remove dead code in openvino EP (#18457) ### Description Remove dead code in openvino EP ### Motivation and Context Remove dead code in openvino EP --- .../providers/openvino/ov_versions/capability.cc | 13 +------------ .../core/providers/openvino/ov_versions/utils.cc | 2 +- .../core/providers/openvino/ov_versions/utils.h | 1 - 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/onnxruntime/core/providers/openvino/ov_versions/capability.cc b/onnxruntime/core/providers/openvino/ov_versions/capability.cc index b030efa238..454f3dd5eb 100644 --- a/onnxruntime/core/providers/openvino/ov_versions/capability.cc +++ b/onnxruntime/core/providers/openvino/ov_versions/capability.cc @@ -146,26 +146,15 @@ std::vector> GetCapability::Execute() { // If subgraph has less then three, graph is considered trivial if (this_cluster.size() < 3) { continue; - } else { - // If subgraph only has Identity node, EyeLike or Dropout, OpenVINO EP doesn't support it. - if (this_cluster.size() == 1) { - const auto& node = graph_viewer_.GetNode(this_cluster[0]); - if (IsOpSupportedOnlyInModel(node->OpType())) - continue; - // If reshape is not an intermediate node, shape needs to be an initializer - if (data_ops_->SpecialConditionForClusterSizeOne(ng_required_initializers, node)) - continue; - } } - std::vector cluster_graph_inputs, cluster_inputs, const_inputs, cluster_outputs; + std::vector cluster_graph_inputs, cluster_inputs, cluster_outputs; GetInputsOutputsOfCluster(graph_viewer_, this_cluster, ng_required_initializers, cluster_graph_inputs, cluster_inputs, - const_inputs, cluster_outputs); bool omit_subgraph = false; diff --git a/onnxruntime/core/providers/openvino/ov_versions/utils.cc b/onnxruntime/core/providers/openvino/ov_versions/utils.cc index 74369d39b9..ee0bfddb7d 100644 --- a/onnxruntime/core/providers/openvino/ov_versions/utils.cc +++ b/onnxruntime/core/providers/openvino/ov_versions/utils.cc @@ -180,12 +180,12 @@ void GetInputsOutputsOfCluster(const GraphViewer& graph_viewer, const std::unordered_set& ng_required_initializers, /*out*/ std::vector& cluster_graph_inputs, /*out*/ std::vector& cluster_inputs, - /*out*/ std::vector& constant_inputs, /*out*/ std::vector& cluster_outputs) { std::unordered_set input_args; std::vector ordered_input_args; std::unordered_set output_args; std::unordered_set external_output_args; + std::vector constant_inputs; for (const auto& node_idx : cluster) { const auto& node = graph_viewer.GetNode(node_idx); diff --git a/onnxruntime/core/providers/openvino/ov_versions/utils.h b/onnxruntime/core/providers/openvino/ov_versions/utils.h index c256cde979..b3edeef88d 100644 --- a/onnxruntime/core/providers/openvino/ov_versions/utils.h +++ b/onnxruntime/core/providers/openvino/ov_versions/utils.h @@ -45,7 +45,6 @@ void GetInputsOutputsOfCluster(const GraphViewer& graph_viewer, const std::unordered_set& ng_required_initializers, /*out*/ std::vector& cluster_graph_inputs, /*out*/ std::vector& cluster_inputs, - /*out*/ std::vector& constant_inputs, /*out*/ std::vector& cluster_outputs); } // namespace openvino_ep