Skip to content

Commit

Permalink
improve lambda and Runner explanation
Browse files Browse the repository at this point in the history
Co-Authored-By: Joseph Weston <[email protected]>
  • Loading branch information
basnijholt and jbweston committed Aug 21, 2021
1 parent 19ee27a commit b6e4c00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Use ``learner.interpolated_on_grid()`` optionally with a argument ``n`` to speci
Why can I not use a ``lambda`` function?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The functions evaluations are done on an executor.
When using the `~adaptive.Runner` the learner's function is evaluated in different Python processes.
Therefore, the ``function`` needs to be serialized (pickled) and send to the executor, ``lambda``\s cannot be pickled.
Instead you can probably use ``functools.partial`` to accomplish what you want to do.

Expand Down

0 comments on commit b6e4c00

Please sign in to comment.