# Module: tf.compat.v1.distribute

<br />

Public API for tf._api.v2.distribute namespace

## Modules

[`cluster_resolver`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/cluster_resolver) module: Public API for tf._api.v2.distribute.cluster_resolver namespace

[`experimental`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/experimental) module: Public API for tf._api.v2.distribute.experimental namespace

## Classes

[`class CrossDeviceOps`](https://www.tensorflow.org/api_docs/python/tf/distribute/CrossDeviceOps): Base class for cross-device reduction and broadcasting algorithms.

[`class HierarchicalCopyAllReduce`](https://www.tensorflow.org/api_docs/python/tf/distribute/HierarchicalCopyAllReduce): Hierarchical copy all-reduce implementation of CrossDeviceOps.

[`class InputContext`](https://www.tensorflow.org/api_docs/python/tf/distribute/InputContext): A class wrapping information needed by an input function.

[`class InputReplicationMode`](https://www.tensorflow.org/api_docs/python/tf/distribute/InputReplicationMode): Replication mode for input function.

[`class MirroredStrategy`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/MirroredStrategy): Synchronous training across multiple replicas on one machine.

[`class NcclAllReduce`](https://www.tensorflow.org/api_docs/python/tf/distribute/NcclAllReduce): NCCL all-reduce implementation of CrossDeviceOps.

[`class OneDeviceStrategy`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/OneDeviceStrategy): A distribution strategy for running on a single device.

[`class ReduceOp`](https://www.tensorflow.org/api_docs/python/tf/distribute/ReduceOp): Indicates how a set of values should be reduced.

[`class ReductionToOneDevice`](https://www.tensorflow.org/api_docs/python/tf/distribute/ReductionToOneDevice): A CrossDeviceOps implementation that copies values to one device to reduce.

[`class ReplicaContext`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/ReplicaContext): A class with a collection of APIs that can be called in a replica context.

[`class RunOptions`](https://www.tensorflow.org/api_docs/python/tf/distribute/RunOptions): Run options for `strategy.run`.

[`class Server`](https://www.tensorflow.org/api_docs/python/tf/distribute/Server): An in-process TensorFlow server, for use in distributed training.

[`class Strategy`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/Strategy): A list of devices with a state \& compute distribution policy.

[`class StrategyExtended`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/StrategyExtended): Additional APIs for algorithms that need to be distribution-aware.

## Functions

[`experimental_set_strategy(...)`](https://www.tensorflow.org/api_docs/python/tf/distribute/experimental_set_strategy): Set a [`tf.distribute.Strategy`](https://www.tensorflow.org/api_docs/python/tf/distribute/Strategy) as current without `with strategy.scope()`.

[`get_loss_reduction(...)`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/distribute/get_loss_reduction): [`tf.distribute.ReduceOp`](https://www.tensorflow.org/api_docs/python/tf/distribute/ReduceOp) corresponding to the last loss reduction.

[`get_replica_context(...)`](https://www.tensorflow.org/api_docs/python/tf/distribute/get_replica_context): Returns the current [`tf.distribute.ReplicaContext`](https://www.tensorflow.org/api_docs/python/tf/distribute/ReplicaContext) or `None`.

[`get_strategy(...)`](https://www.tensorflow.org/api_docs/python/tf/distribute/get_strategy): Returns the current [`tf.distribute.Strategy`](https://www.tensorflow.org/api_docs/python/tf/distribute/Strategy) object.

[`has_strategy(...)`](https://www.tensorflow.org/api_docs/python/tf/distribute/has_strategy): Return if there is a current non-default [`tf.distribute.Strategy`](https://www.tensorflow.org/api_docs/python/tf/distribute/Strategy).

[`in_cross_replica_context(...)`](https://www.tensorflow.org/api_docs/python/tf/distribute/in_cross_replica_context): Returns `True` if in a cross-replica context.