pytaco.set_num_threads
- pytaco.set_num_threads(num_threads)
Set the number of threads taco should use to perform computations.
The number of threads taco should use when running operations that can be done in parallel.
- Parameters
- num_threads: int
The number of threads taco should use when performing computations. The number of threads must be positive. Taco will ignore attempting to set the number of threads to a number less than or equal to 0.
Notes
Attempting to parallelize some expressions might lead to incorrect behaviour. In this case, taco will use one thread if it determines an expression not parallelizable.
Examples
>>> import pytaco as pt >>> pt.set_num_threads(4) # tell taco to use 4 threads >>> pt.get_num_threads() 4 >>> pt.set_num_threads(0) # ignored >>> pt.get_num_threads() # Will be 4 since the last set was ignored 4