Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Commit faecd9d

Browse files
kimishpatelbwasti
authored andcommitted
Removed duplicate node creation. (#85)
* Removed duplicate node creation. Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: * Made changes according to review comments. Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent c80f148 commit faecd9d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

torch_tvm/compiler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ tvm::relay::Function TVMCompiler::convertToRelay(
149149
for (const auto& use : uses) {
150150
tvm::Array<tvm::relay::Expr> relay_inputs;
151151
auto skip_user = false;
152+
if (std::any_of(use.user->outputs().begin(), use.user->outputs().end(),
153+
[&value_map](Value* const output){return value_map.count(output);})) {
154+
continue;
155+
}
152156
for (const auto& input : use.user->inputs()) {
153157
if (value_map.find(input) == value_map.end()) {
154158
// We may be dealing with a constant, handle that here

0 commit comments

Comments
 (0)