Skip to content

Commit

Permalink
Skip mark_node in shape flow for reorder node if dependency node is b…
Browse files Browse the repository at this point in the history
…roadcase

Signed-off-by: yuan.xiong <[email protected]>
  • Loading branch information
yuanxion committed Dec 2, 2024
1 parent 4c8c290 commit 210cf48
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//

#include "broadcast_inst.h"
#include "reorder_inst.h"
#include "shape_of_inst.h"
#include "read_value_inst.h"
#include "reshape_inst.h"
Expand All @@ -26,6 +28,10 @@ void mark_shape_of_subgraphs::look_for_shape_of_subgraph(program_node& node) {
bool has_shape_of_subgraph_dep = false;
for (auto& dependency : node.get_dependencies()) {
if (dependency.first->is_in_shape_of_subgraph()) {
// skip mark_node for reorder node if dependency node is broadcast
if (dependency.first->is_type<broadcast>() && node.is_type<reorder>()) {
break;
}
has_shape_of_subgraph_dep = true;
} else if (!dependency.first->is_constant()) {
can_execute_in_subgraph = false;
Expand Down

0 comments on commit 210cf48

Please sign in to comment.