diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp index 2d7a6ea8183cd4..a40c7dfebb9de6 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp @@ -22,13 +22,6 @@ void mark_shape_of_subgraphs::look_for_shape_of_subgraph(program_node& node) { return; } - // skip mark_node for broadcast node if dependency nodes are data and shape_of - auto& dependencies = node.get_dependencies(); - if (node.is_type() && dependencies.size() == 2) { - if (dependencies[0].first->is_type() && dependencies[1].first->is_type()) - return; - } - // Check if all dependencies are constant or marked as a part of shape_of subgraph bool can_execute_in_subgraph = true; bool has_shape_of_subgraph_dep = false; @@ -94,6 +87,13 @@ bool mark_shape_of_subgraphs::can_mark_node(const program_node& node) { return false; } + // skip mark_node for broadcast node if dependency nodes are data and shape_of + auto& dependencies = node.get_dependencies(); + if (node.is_type() && dependencies.size() == 2) { + if (dependencies[0].first->is_type() && dependencies[1].first->is_type()) + return false; + } + return true; }