-
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
[RFC][Hybrid Script] Syntax sugars for Hybrid Script #2262
Comments
continue is not supported. |
Logical operator 'and', 'or' and 'not' are not supported. |
@kevinthesun @tqchen Also I am not sure, what impact will be on the control flow graph, after adding these backend supports. |
I don't think it is a good idea to support break/continue, since they will break the analysis completely. |
@tqchen Exactly, I know the current analysis is specific to loops without |
Chain of logical expr is not supported. if a < b and c < d and e < f: |
@kevinthesun Can you be more specific that I can replicate it? |
@tvm.hybrid.script
def test(a, bool_val):
b = output_tensor((a.shape[0],), a.dtype)
if a[0] > 4 and a[1] < 4.5 and bool_val:
b[0] = max(a[0], 5.0)
return b
if __name__ == '__main__':
a_plc = tvm.placeholder((5,), dtype="float32")
bool_v = tvm.const(True, dtype="bool")
out = test(a_plc, bool_v) |
#2287 Can you refer this one's last test case? At least that works fine for me. |
@kevinthesun Can you show me something more concrete instead of a rough code snippet? |
@kevinthesun
|
Close this RFC for now as most discussed items has been implemented, please open new threads for new feature discussion |
Hybrid Script is still under a very preliminary stage of development.
Comparing with its counterpart in FaceBook, TorchScript, a lot of syntax sugars are not supported yet.
Global function callDonefoo
can be found in__global__
dict, so it is not hard to do this I believe.Triple inequityDone@kevinthesun Any more suggestions?
The text was updated successfully, but these errors were encountered: