Skip to content

Commit 80b1038

Browse files
committedApr 27, 2021
fix: erase the repetitive nodes in dependency analysis
Signed-off-by: Bo Wang <wangbo1995ee@163.com>
1 parent 4a318a2 commit 80b1038

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎core/partitioning/partitioning.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ std::vector<SegmentedBlock> injectNodesForNonTensorInputs(SegmentedBlock& seg_bl
9797
if (containNonTensorInputs(n, nontensor_inputs_set) || prev_non_tensor_outputs) {
9898
if (!tensorrt_nodes.empty()) {
9999
new_seg_blocks.emplace_back(SegmentedBlock::kTensorRT, tensorrt_nodes);
100+
tensorrt_nodes.clear();
100101
}
101102
pytorch_nodes.push_back(n);
102103
prev_non_tensor_outputs = containNonTensorOutputs(n);
103104
} else {
104105
if (!pytorch_nodes.empty()) {
105106
new_seg_blocks.emplace_back(SegmentedBlock::kTorch, pytorch_nodes);
107+
pytorch_nodes.clear();
106108
}
107109
tensorrt_nodes.push_back(n);
108110
}

0 commit comments

Comments
 (0)
Please sign in to comment.