LocalConfig

class tf_encrypted.config.LocalConfig(player_names=None, job_name='localhost', auto_add_unknown_players=True)[source]

Configure TF Encrypted to use threads on the local CPU.

Each thread instantiates a different Player to simulate secure computations without requiring networking. Mostly intended for development/debugging use.

By default new players will be added when looked up for the first time; this is useful for instance to get a complete list of players involved in a particular computation (see auto_add_unknown_players).

Parameters:
  • player_names ((str)) – List of players to be used in the session.
  • job_name (str) – The name of the job.
  • auto_add_unknown_players (bool) – Auto-add player on first lookup.
get_player(name_or_player)[source]

Retrieve a specific Player object by name.

For convenience it is also possible to pass in an existing Player object, which will simply be returned as-is if the player is known already.

get_tf_config(log_device_placement=False) → tf.ConfigProto, or str[source]

Extract the underlying tf.ConfigProto.

players

Returns the config’s list of Player objects.