Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/tutorials/basic/part4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ toolbox.
import multiprocessing

pool = multiprocessing.Pool()
# OR use the following to ensure releasing memory after each evaluate call
# This helps in situation where an external library holds memory, ex: Tensorflow
# when maxtaskperchild is set to 1, a new process is forked after each completed task
# https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing.pool
# pool = multiprocessing.Pool(maxtasksperchild=1)

toolbox.register("map", pool.map)

# Continue on with the evolutionary algorithm
Expand Down