execution

class zfit.util.execution.RunManager(n_cpu='auto')[source]

Bases: object

Handle the resources and runtime specific options. The run method is equivalent to sess.run

aquire_cpu(max_cpu: int = -1) → List[str][source]
auto_initialize(variable: tensorflow.python.ops.variables.VariableV1)[source]
chunksize
create_session(*args, close_current=True, reset_graph=False, **kwargs)[source]

Create a new session (or replace the current one). Arguments will overwrite the already set arguments.

Parameters:
  • close_current (bool) – Closes the current open session before replacement. Has no effect if no session was created before.
  • reset_graph (bool) – Resets the current (default) graph before creating a new tf.compat.v1.Session.
  • () (**kwargs) –
  • ()
Returns:

tf.compat.v1.Session

n_cpu
reset()[source]
sess
set_n_cpu(n_cpu='auto')[source]
class zfit.util.execution.SessionHolderMixin(*args, **kwargs)[source]

Bases: object

Creates a self.sess attribute, a setter set_sess (with a fallback to the zfit default session).

sess
set_sess(sess: tensorflow.python.client.session.Session)[source]

Set the session (temporarily) for this instance. If None, the auto-created default is taken.

Parameters:sess (tf.compat.v1.Session) –