File tree 1 file changed +5
-1
lines changed 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ Adaptive by itself does not implement a way of sharing partial results between f
373
373
Its implementation of parallel computation using executors is minimal by design.
374
374
Instead the appropriate way to implement custom parallelization is by using coroutines (asynchronous functions).
375
375
376
- We illustrate this approach by using dask.distributed for parallel computations in part because it supports asynchronous operation out-of-the-box.
376
+ We illustrate this approach by using ` dask.distributed ` for parallel computations in part because it supports asynchronous operation out-of-the-box.
377
377
Let us consider a function ` f(x) ` which is composed by two parts.
378
378
It has a slow part ` g ` which can be reused by multiple inputs and shared between workers.
379
379
It has fast part ` h ` that will be computed for every ` x ` .
@@ -382,6 +382,10 @@ It has fast part `h` that will be computed for every `x`.
382
382
import time
383
383
384
384
def f(x):
385
+ """
386
+ Integer part of `x` will be reused
387
+ Decimal part requires a new computation
388
+ """
385
389
return g(int(x)) + h(x % 1)
386
390
387
391
You can’t perform that action at this time.
0 commit comments