Uh oh!
There was an error while loading. Please reload this page.
[Relay] Move prelude to text format - #3939
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| def @id[a](%x: a) -> a { | ||
| %x | ||
| // TODO(weberlo): should we add sugar for scalar types (e.g., `int32` => `Tensor[(), int32]`)? |
There was a problem hiding this comment.
Good idea, though it probably merits wider discussion
jroesch
commented
Sep 13, 2019
zhiics
commented
Sep 13, 2019
Will do over the weekend. |
It needs to also follow the "add unchecked, add checked" pattern
58be955 to
67302e9Compare| AddUnchecked(var, checked_func); | ||
| } | ||
| void ModuleNode::AddUnchecked(const GlobalVar& var, |
There was a problem hiding this comment.
Isn't this function the same as before?
There was a problem hiding this comment.
yeah. I just moved it next to Add for readability. I can move it back if you want.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
weberlo
commented
Sep 27, 2019
The CI failure was because the VM compiler can't compile programs which make use of first-class constructors. For example, needs to be rewritten as , in order to successfully compile. @jroesch We do want first-class constructors, right? If so, I'll submit a follow-up PR that adds that functionality. |
weberlo
commented
Sep 29, 2019
@wweic CI is green |
jroesch
commented
Sep 29, 2019
We should handle this with a full eta-expansion pass, I will try to find some resources on performing eta-expansion for these types of purposes. |
* Fix parser * Doc fix * Add module utility functions necessary for prelude * Implement prelude in text format * Remove programmatically constructed prelude defs * Fix 0-arity type conses in pretty printer and test * Make prelude loading backwards-compatible * Fix patterns * Improve some prelude defs * Fix `ImportFromStd` It needs to also follow the "add unchecked, add checked" pattern * Lint roller * Woops * Address feedback * Fix `test_list_constructor` VM test * Fix `test_adt.py` failures
* Fix parser * Doc fix * Add module utility functions necessary for prelude * Implement prelude in text format * Remove programmatically constructed prelude defs * Fix 0-arity type conses in pretty printer and test * Make prelude loading backwards-compatible * Fix patterns * Improve some prelude defs * Fix `ImportFromStd` It needs to also follow the "add unchecked, add checked" pattern * Lint roller * Woops * Address feedback * Fix `test_list_constructor` VM test * Fix `test_adt.py` failures
* Fix parser * Doc fix * Add module utility functions necessary for prelude * Implement prelude in text format * Remove programmatically constructed prelude defs * Fix 0-arity type conses in pretty printer and test * Make prelude loading backwards-compatible * Fix patterns * Improve some prelude defs * Fix `ImportFromStd` It needs to also follow the "add unchecked, add checked" pattern * Lint roller * Woops * Address feedback * Fix `test_list_constructor` VM test * Fix `test_adt.py` failures
* master: Fix split's last factor issue (apache#4044) [COMMUNITY] ajtulloch -> committer (apache#4043) [TOPI]Add op argwhere (apache#3994) [topi] add ARM v8.2 udot (uint8) support (apache#3978) [COMMUNITY] anijain2305 -> reviewer (apache#4036) [QNN] Renaming dense operator. (apache#4033) [Relay][Compile_engine] Int64 shape handling for outputs. (apache#4031) Add dmlc-core to the list of installed header directories. (apache#4035) [ARITH] migrate indexdiv/mod to floordiv/mod (apache#4008) [Relay] Move prelude to text format (apache#3939) make tvm compilable by gcc 4.9.2 (apache#4032) [AUTOTVM][DOCS] Add a link to the defining network description of auto-tuning tutorial (apache#4023) [ARITH] cleanup the indexmod/div on python side (apache#4028) [Fix] Add more pad_mode support for onnx converter (apache#4029) Add parser support for ReLU tflite operator (apache#4022) Additional MXNet Convolution and Deconvolution tests (apache#4026) docs: minor spelling tweaks (apache#4027)
This PR is a follow-up to #3863, which replaces the hand-constructed ASTs in the current prelude with equivalent definitions in the text format.
One question I have about syntax is how we should handle zero-arity constructors. Most functional languages desugar, for example,
NilintoNil(), and I've implemented that functionality here. Let me know if that's not what we want.CC @MarisaKirisame@slyubomirsky@jroesch@junrushao1994