Skip to content

Commit

Permalink
fix: erase the repetitive nodes in dependency analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Bo Wang <[email protected]>
  • Loading branch information
bowang007 committed Apr 27, 2021
1 parent 4a318a2 commit 80b1038
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/partitioning/partitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ std::vector<SegmentedBlock> injectNodesForNonTensorInputs(SegmentedBlock& seg_bl
if (containNonTensorInputs(n, nontensor_inputs_set) || prev_non_tensor_outputs) {
if (!tensorrt_nodes.empty()) {
new_seg_blocks.emplace_back(SegmentedBlock::kTensorRT, tensorrt_nodes);
tensorrt_nodes.clear();
}
pytorch_nodes.push_back(n);
prev_non_tensor_outputs = containNonTensorOutputs(n);
} else {
if (!pytorch_nodes.empty()) {
new_seg_blocks.emplace_back(SegmentedBlock::kTorch, pytorch_nodes);
pytorch_nodes.clear();
}
tensorrt_nodes.push_back(n);
}
Expand Down

0 comments on commit 80b1038

Please sign in to comment.