mindspore.dataset.config.get_num_parallel_workers

mindspore.dataset.config.get_num_parallel_workers()

Get the global configuration of number of parallel workers. This is the DEFAULT num_parallel_workers value used for each operation. If set_num_parallel_workers is never called before, the default value(8) will be returned.

Returns

int, number of parallel workers to be used as a default for each operation.

Examples

>>> # Get the global configuration of parallel workers.
>>> # If set_num_parallel_workers() is never called before, the default value(8) will be returned.
>>> import mindspore.dataset as ds
>>> num_parallel_workers = ds.config.get_num_parallel_workers()