Skip to content

Commit

Permalink
changing visit logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanmukh committed Jul 26, 2021
1 parent 6aba042 commit f4b4bad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/tvm/relay/op/contrib/tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
from tvm import relay
from tvm.relay import transform
from tvm.relay.build_module import bind_params_by_name
from tvm.relay.expr import Call, Constant, Tuple, GlobalVar, Var, TupleGetItem, Let
from tvm.relay.expr import Call, Constant, Tuple, GlobalVar, Var, TupleGetItem
from tvm.ir import Op
from tvm.relay.expr_functor import ExprMutator, ExprVisitor

logger = logging.getLogger("TensorRT")
Expand Down Expand Up @@ -1033,10 +1034,9 @@ def visit_tuple_getitem(self, op):
visit = super().visit_tuple_getitem(op)
if visit.index != 0:
return visit
if isinstance(visit.tuple_value, Call) and isinstance(visit.tuple_value.op, Let):
return visit
if (
isinstance(visit.tuple_value, Call)
and isinstance(visit.tuple_value.op, Op)
and visit.tuple_value.op.name == "nn.dropout"
and visit.index == 0
):
Expand Down

0 comments on commit f4b4bad

Please sign in to comment.