T
- data type for values()
output@Operator(group="sparse") public final class SparseAccumulatorTakeGradient<T> extends PrimitiveOp
The op will 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 will return its average of the accumulated gradients. Also automatically increments the recorded global_step in the accumulator by 1, and resets the aggregate to 0.
operation
Modifier and Type | Method and Description |
---|---|
static <T> SparseAccumulatorTakeGradient<T> |
create(Scope scope,
Operand<String> handle,
Operand<Integer> numRequired,
Class<T> dtype)
Factory method to create a class wrapping a new SparseAccumulatorTakeGradient operation.
|
Output<Long> |
indices()
Indices of the average of the accumulated sparse gradients.
|
Output<Long> |
shape()
Shape of the average of the accumulated sparse gradients.
|
Output<T> |
values()
Values of the average of the accumulated sparse gradients.
|
equals, hashCode, op, toString
public static <T> SparseAccumulatorTakeGradient<T> create(Scope scope, Operand<String> handle, Operand<Integer> numRequired, Class<T> dtype)
scope
- current scopehandle
- The handle to a SparseConditionalAccumulator.numRequired
- Number of gradients required before we return an aggregate.dtype
- The data type of accumulated gradients. Needs to correspond to the type
of the accumulator.Copyright © 2022. All rights reserved.