-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass #8506
Conversation
if isinstance(visit.tuple_value, Call) and isinstance(visit.tuple_value.op, Let): | ||
return visit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit ad-hoc to me. Suggest as follows. Note that I'm not sure if isinstance(visit.tuple_value.op, Op)
is the correct expression but you should know what I meant.
if isinstance(visit.tuple_value, Call):
if isinstance(visit.tuple_value.op, Op) and visit.tuple_value.op.name == "nn.dropout" and visit.index == 0:
return visit.tuple_value.args[0]
return visit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @comaniac . Changed the logic as appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* [TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass * refactor the logic
…ache#8506) * [TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass * changing visit logic
…ache#8506) * [TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass * changing visit logic
This commit handles a corner case in TRT RemoveDropout pass. This avoids an error like below