# tf.raw_ops.ConditionalAccumulator

<br />

A conditional accumulator for aggregating gradients.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.ConditionalAccumulator`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/ConditionalAccumulator)

<br />

    tf.raw_ops.ConditionalAccumulator(
        dtype,
        shape,
        container='',
        shared_name='',
        reduction_type='MEAN',
        name=None
    )

The accumulator accepts gradients marked with local_step greater or
equal to the most recent global_step known to the accumulator. The
average can be extracted from the accumulator, provided sufficient
gradients have been accumulated. Extracting the average automatically
resets the aggregate to 0, and increments the global_step recorded by
the accumulator.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `dtype` | A [`tf.DType`](https://www.tensorflow.org/versions/r2.14/api_docs/python/tf/dtypes/DType) from: `tf.float32, tf.float64, tf.int32, tf.uint8, tf.int16, tf.int8, tf.complex64, tf.int64, tf.qint8, tf.quint8, tf.qint32, tf.bfloat16, tf.qint16, tf.quint16, tf.uint16, tf.complex128, tf.half, tf.uint32, tf.uint64`. The type of the value being accumulated. |
| `shape` | A [`tf.TensorShape`](https://www.tensorflow.org/versions/r2.14/api_docs/python/tf/TensorShape) or list of `ints`. The shape of the values, can be \[\], in which case shape is unknown. |
| `container` | An optional `string`. Defaults to `""`. If non-empty, this accumulator is placed in the given container. Otherwise, a default container is used. |
| `shared_name` | An optional `string`. Defaults to `""`. If non-empty, this accumulator will be shared under the given name across multiple sessions. |
| `reduction_type` | An optional `string` from: `"MEAN", "SUM"`. Defaults to `"MEAN"`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type mutable `string`. ||

<br />