[Codegen] Fix if_then_else codegen#16242
Merged
jinhongyii merged 5 commits intoapache:mainfrom Jan 4, 2024
spectrometerHBH:fix
Merged
[Codegen] Fix if_then_else codegen#16242jinhongyii merged 5 commits intoapache:mainfrom spectrometerHBH:fix
jinhongyii merged 5 commits intoapache:mainfrom
spectrometerHBH:fix
Conversation
junrushao
reviewed
Dec 17, 2023
Member
|
isn't short circuiting the defined behavior for ternary expression? |
Contributor
Author
When generating codes for |
jinhongyii
approved these changes
Jan 4, 2024
junrushao
added a commit
to junrushao/tvm
that referenced
this pull request
Jan 7, 2024
* fix * lint * fix while loop * clean * clean --------- Co-authored-by: Junru Shao <junrushao1994@gmail.com>
Contributor
Hi, bohan, I recently am supporting Ternary Operator(like cond?true_branch:false_branch) in our device. I don't understand this modification. Can u explain this with a case? Thanks a lot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evaluating
op.if_then_elsewitha?b:cis potentially dangerous as it might evaluate expressions in branches without a guard of condition.While loop condition expression might require several var bindings generated, so we correct the while loop codegen from
while (cond)towhile (True)