Does Dask support multi-output functions in custom charts?

Custom Dask API graphics seem to support only functions that return a single output key / value.

For example, the following dependency cannot be easily represented as a Dask graph:

    B -> D
   /      \
A-         -> F
   \      /
    C -> E

This can be circumvented by storing the tuple under the "composite" key (for example, "B_C" in this case), and then dividing it into getitem()or similar. However, this can lead to inefficient execution (for example, unnecessary serialization) and a decrease in the clarity of DAG rendering.

Is there a better way or is it currently not supported?

+4
source share
1

, .

, Dask - getitem. , dask.delayed - getitem, . :

from dask import delayed

@delayed(pure=True)
def minmax(a, b):
    if a > b:
        return a, b
    else:
        return b, a

result = minmax(1, 2)
min, max = result[0], result[1]

. ( ) , . .

+3

Source: https://habr.com/ru/post/1648057/


All Articles