dask 2021.10.0

ParametersBackRef
compute(*args, **kwargs)

Parameters

args : object

Any number of objects. If it is a dask object, it's computed and the result is returned. By default, python builtin collections are also traversed to look for dask objects (for more information see the traverse keyword). Non-dask arguments are passed through unchanged.

traverse : bool, optional

By default dask traverses builtin python collections looking for dask objects passed to compute . For large collections this can be expensive. If none of the arguments contain any dask objects, set traverse=False to avoid doing this traversal.

scheduler : string, optional

Which scheduler to use like "threads", "synchronous" or "processes". If not provided, the default is to check the global settings first, and then fall back to the collection defaults.

optimize_graph : bool, optional

If True [default], the optimizations for each collection are applied before computation. Otherwise the graph is run as is. This can be useful for debugging.

kwargs :

Extra keywords to forward to the scheduler function.

Compute several dask collections at once.

Examples

This example is valid syntax, but we were not able to check execution
>>> import dask as d
... import dask.array as da
... a = da.arange(10, chunks=2).sum()
... b = da.arange(10, chunks=2).mean()
... d.compute(a, b) (45, 4.5)

By default, dask objects inside python collections will also be computed:

This example is valid syntax, but we were not able to check execution
>>> d.compute({'a': a, 'b': b, 'c': 1})
({'a': 45, 'b': 4.5, 'c': 1},)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.base.compute dask.base.DaskMethodsMixin.compute

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/base.py#511
type: <class 'function'>
Commit: