Skip to content

workers

get_num_workers() #

Utility function to set dataloader's num_workers based on OS.

Source code in src/careamics_napari/utils/workers.py
4
5
6
7
8
9
def get_num_workers():
    """Utility function to set dataloader's num_workers based on OS."""
    if platform.system() == "Windows" or platform.system() == "Darwin":
        return 0
    else:
        return 3  # or any other number suitable for your system