L ihddlZddlmZddlmZdZGddejjZy)N) SimpleQueuecjddl}tjj|i||j y)Nr)gcmultiprocessingpoolworkercollect)argskwargsrs `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/multiprocessing/pool.py clean_workerrs) 00JJLceZdZdZdZdZy)PoolzPool implementation which uses our version of SimpleQueue. This lets us pass tensors in shared memory across processes instead of serializing the underlying data. ct|_t|_|jjj|_|jj j|_y)N) r_inqueue _outqueue_writersend _quick_put_readerrecv _quick_get)selfs r _setup_queueszPool._setup_queuessB#  $--//44..0055rc t|jt|jz D]}|j|j |j |j|jf}t|dr||jfz }|jt|}|jj||jjdd|_d|_|j#t%j&dy)zIncrease the number of pool processes to the specified number. Bring the number of pool processes up to the specified number, for use after reaping workers which have exited. _wrap_exception)targetr Process PoolWorkerTz added workerN)range _processeslen_poolrr _initializer _initargs_maxtasksperchildhasattrrr rappendnamereplacedaemonstartutildebug)r_r ws r _repopulate_poolzPool._repopulate_pools tTZZ89 'A !!&& Dt./--// Lt r<s+##'?   $ $#'r