LostTech.TensorFlow : API Documentation

Type ReplicaContext

Namespace tensorflow.distribute

Parent PythonObjectContainer

Interfaces IReplicaContext, IContextManager<T>

tf.distribute.Strategy API when in a replica context.

You can use tf.distribute.get_replica_context to get an instance of `ReplicaContext`. This should be inside your replicated step function, such as in a tf.distribute.Strategy.experimental_run_v2 call.

Properties

Public properties

object devices get;

The devices this replica is to be executed on, as a tuple of strings.

object devices_dyn get;

The devices this replica is to be executed on, as a tuple of strings.

object num_replicas_in_sync get;

Returns number of replicas over which gradients are aggregated.

object num_replicas_in_sync_dyn get;

Returns number of replicas over which gradients are aggregated.

object PythonObject get;

object replica_id_in_sync_group get;

Returns the id of the replica being defined.

This identifies the replica that is part of a sync group. Currently we assume that all sync groups contain the same number of replicas. The value of the replica id can range from 0 to `num_replica_in_sync` - 1.

object replica_id_in_sync_group_dyn get;

Returns the id of the replica being defined.

This identifies the replica that is part of a sync group. Currently we assume that all sync groups contain the same number of replicas. The value of the replica id can range from 0 to `num_replica_in_sync` - 1.

object strategy get;

The current tf.distribute.Strategy object.

object strategy_dyn get;

The current tf.distribute.Strategy object.