Avoids creating a thread pool and pushing work to async Python threads when there is only one GPU. This is unnecessary when there is only one GPU because the thread pool only has one worker, and GPU work is async anyways.
Approach
Replaces the ThreadPool with a placeholder class when there is only one worker.
Pre-Merge Checklists
Submitter
[x] Write a helpfully descriptive pull request title.
[x] Organize changes into logically grouped commits with descriptive commit messages.
[x] Document all new functions.
[ ] Click 'details' on the readthedocs check to view the updated docs.
[ ] Write tests for new functions or explain why they are not needed.
[ ] Address any complaints from pep8speaks.
Reviewer
[ ] Actually read all of the code.
[ ] Run the new code yourself; the included tests should make this easy.
[ ] Write a summary of the changes as you understand them.
Purpose
Avoids creating a thread pool and pushing work to async Python threads when there is only one GPU. This is unnecessary when there is only one GPU because the thread pool only has one worker, and GPU work is async anyways.
Approach
Replaces the ThreadPool with a placeholder class when there is only one worker.
Pre-Merge Checklists
Submitter
Reviewer