Type InputContext
Namespace tensorflow.distribute
Parent PythonObjectContainer
Interfaces IInputContext
A class wrapping information needed by an input function. This is a context class that is passed to the user's input function and
contains information about the compute replicas and input pipelines. The
number of compute replicas (in sync training) helps compute the local batch
size from the desired global batch size for each replica. The input pipeline
information can be used to return a different subset of the input in each
replica (for e.g. shard the input pipeline, use a different input
source etc).
Methods
Properties
Public instance methods
int get_per_replica_batch_size(int global_batch_size)
Returns the per-replica batch size.
Parameters
-
int
global_batch_size - the global batch size which should be divisible by `num_replicas_in_sync`.
Returns
-
int
- the per-replica batch size.
object get_per_replica_batch_size_dyn(object global_batch_size)
Returns the per-replica batch size.
Parameters
-
object
global_batch_size - the global batch size which should be divisible by `num_replicas_in_sync`.
Returns
-
object
- the per-replica batch size.
Public properties
int input_pipeline_id get;
Returns the input pipeline ID.
object input_pipeline_id_dyn get;
Returns the input pipeline ID.
int num_input_pipelines get;
Returns the number of input pipelines.
object num_input_pipelines_dyn get;
Returns the number of input pipelines.
int num_replicas_in_sync get;
Returns the number of compute replicas in sync.
object num_replicas_in_sync_dyn get;
Returns the number of compute replicas in sync.