Skip to content

Commit 60b0cad

Browse files
committed
fix: fix the issue that some If blocks in Loop blocks are segmented
1 parent 5f43bf1 commit 60b0cad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/partitioning/partitioningctx/PartitioningCtx.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ PartitioningCtx::PartitioningCtx(torch::jit::Block* b, PartitioningInfo info)
1515
}
1616

1717
void PartitioningCtx::_load_nodes_into_decision_map(torch::jit::Block* b) {
18-
if (!b->owningNode() || b->owningNode()->kind() != torch::jit::prim::Loop) {
19-
original_blocks.push_back(b);
20-
}
18+
if (b->owningNode() && b->owningNode()->kind() == torch::jit::prim::Loop)
19+
return;
20+
21+
original_blocks.push_back(b);
22+
2123
for (const auto n : b->nodes()) {
2224
if (n->kind() == torch::jit::prim::Constant) {
2325
continue;

0 commit comments

Comments
 (0)