Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Currently the usage of UDFs is restricted to simply being able to call the UDF and assign the results to a variable. If the user wishes to use the UDF as input to the builtin-op of any sort on the same line, an error is thrown. This is confusing for users and leads to a messy code involving temporary variables.
example:
out = my_udf_func(x) + 4
The UDFs should be treated like any other Op.
Quick background:
The functions are initially split into separate statement blocks so they can bind their outputs (potentially many) directly to logical variable names because Hop DAGs cannot represent multiple outputs, just multiple consumers.
Originally function, function calls were not even represented as Hops but constructed as special instructions. Later we defined a three phase transition for a seamless integration.
- 1. Represent function calls via FunctionOps in the Hop DAG.
- 2. Allow arbitrary expressions for inputs of FunctionOps.
- 3. Allow FunctionOps with single outputs in expressions. (yet to be completed.)
Solution:
It would essentially entail modification to the passes(language validate, IPA, rewrites for splitting, Hop DAGs for recompilation, Hop-Lop translation, Lop instruction generation.)
Attachments
Issue Links
- duplicates
-
SYSTEMDS-1444 UDFs w/ single output in expressions
- Closed
- is related to
-
SYSTEMDS-588 Improve UDFs
- In Progress