Function mindspore::dataset::config::set_num_parallel_workers

Function Documentation

bool mindspore::dataset::config::set_num_parallel_workers(int32_t num_parallel_workers)

A function to set the default number of parallel workers.

Parameters

num_parallel_workers[in] Number of parallel workers to be used as the default for each operation.

Returns

The workers is set successfully or not.

样例
// Set a new global configuration value for the number of parallel workers.
// Now parallel dataset operators will run with 16 workers.
bool rc = config::set_num_parallel_workers(16);