# tf.raw_ops.ResourceAccumulatorTakeGradient

<br />

Extracts the average gradient in the given ConditionalAccumulator.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.ResourceAccumulatorTakeGradient(
        handle, num_required, dtype, name=None
    )

The op blocks until sufficient (i.e., more than num_required)
gradients have been accumulated. If the accumulator has already
aggregated more than num_required gradients, it returns the average of
the accumulated gradients. Also automatically increments the recorded
global_step in the accumulator by 1, and resets the aggregate to 0.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `handle` | A `Tensor` of type `resource`. The handle to an accumulator. |
| `num_required` | A `Tensor` of type `int32`. Number of gradients required before we return an aggregate. |
| `dtype` | A [`tf.DType`](https://www.tensorflow.org/versions/r2.13/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 data type of accumulated gradients. Needs to correspond to the type of the accumulator. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `dtype`. ||

<br />