.compute() 函数

在看一个机器学习项目的源码时,看到有一个.compute()函数,结果到处都找不到它的用法,不过最后还是在Dask官网里找到了。


下面是英文的文档,各位可以就着百度翻译查看。

compute(**kwargs)

Compute this dask collection
This turns a lazy Dask collection into its in-memory equivalent. For example a Dask.array turns into a numpy.array() and a Dask.dataframe turns into a Pandas dataframe. The entire dataset must fit into memory before calling this operation.

  • Parameters:
    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 graph is optimized before computation. Otherwise the graph is run as is. This can be useful for debugging.
    kwargs
    Extra keywords to forward to the scheduler function.

你可能感兴趣的:(编程知识)