Call for ifExp supporting
Right now I am working on the parser of tvm.tir.script, but a minor question that I met is about tvm.tir.Select. This function is related to IfExp node. When will be IfExp node supported in synr? Thank you.
Hey thanks for asking! I believe tir.Select is a bit different from tir.IfThenElse in terms of semantics. @Hzfengsy would you like to confirm?
To make sure I understand this question, are you asking if it is possible to translate python's XXX if CCC else YYY expression to tir.IfThenElse?
IfThenElseNode is a stmt with two sub-stmt then_case and else_case, it equals to
if condition:
then_case
else:
else_case
tir.Select is an expr with true_value and false_value, which equals to
true_value if condition else false_value
IIRC, it is not supported by now. I can support it when I have time.
Thank you @junrushao1994 and @Hzfengsy. true_value if condition else false_value is quite important when I process these control flow of Scalars.
By the way, do you have any plan to support cross function calls? I take the code snippet below for example,
def A():
return 0
def main():
a = A ()
That will be quite useful when we implement these long tail operators like nms and region_proposal, etc. Thank you very much!