zfit.run.set_cpus_explicit#

run.set_cpus_explicit(inter)#

Set the number of threads (cpus) used for inter-op and intra-op parallelism.

This method should be called immediately after import zfit, before performing any operations that would trigger TensorFlow initialization.

import zfit
zfit.run.set_cpus_explicit(intra=2, inter=4)
# Now use zfit normally
Parameters:
  • intra (int) – Number of threads used to perform an operation. For larger operations, e.g. large Tensors, this is usually beneficial to have >= 2.

  • inter (int) – Parallelization on the level of ops. This is beneficial, if many operations can be computed independently in parallel.

Return type:

None