Extracts the average gradient in the given ConditionalAccumulator.
View aliases
Compat aliases for migration
See Migration guide for more details.
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.
Args | |
---|---|
handle
|
A Tensor of type resource . The handle to an accumulator.
|
num_
|
A Tensor of type int32 .
Number of gradients required before we return an aggregate.
|
dtype
|
A tf.DType from: tf. .
The data type of accumulated gradients. Needs to correspond to the type
of the accumulator.
|
name
|
A name for the operation (optional). |
Returns | |
---|---|
A Tensor of type dtype .
|