def allreduce(value, name=None, average=True, prescale_factor=1.0, postscale_factor=1.0, op=None, compression=Compression.none): """ Perform an allreduce on a tensor-compatible value. Arguments: value: A tensor-compatible value to reduce. The shape of the input must be identical across all ranks. name: Optional name for the constants created by this operation. average: .. warning:: .. deprecated:: 0.19.0 Use `op` instead. Will be removed in v0.21.0. prescale_factor: Multiplicative factor to scale tensor before allreduce. postscale_factor: Multiplicative factor to scale tensor after allreduce. op: The reduction operation to combine tensors across different ranks. Defaults to Average if None is given. compression: Compression algorithm used to reduce the amount of data sent and received by each worker node. Defaults to not using compression. """ return _impl.allreduce(backend=K, value=value, name=name, average=average, prescale_factor=prescale_factor, postscale_factor=postscale_factor, op=op, compression=compression)
def allreduce(value, name=None, average=True): """ Perform an allreduce on a tensor-compatible value. Arguments: value: A tensor-compatible value to reduce. The shape of the input must be identical across all ranks. name: Optional name for the constants created by this operation. average: If True, computes the average over all ranks. Otherwise, computes the sum over all ranks. """ return _impl.allreduce(K, value, name, average)
def allreduce(value, name=None, average=True, prescale_factor=1.0, postscale_factor=1.0): """ Perform an allreduce on a tensor-compatible value. Arguments: value: A tensor-compatible value to reduce. The shape of the input must be identical across all ranks. name: Optional name for the constants created by this operation. average: If True, computes the average over all ranks. Otherwise, computes the sum over all ranks. prescale_factor: Multiplicative factor to scale tensor before allreduce. postscale_factor: Multiplicative factor to scale tensor after allreduce. """ return _impl.allreduce(K, value, name, average, prescale_factor, postscale_factor)