@Operator(group="sparse") public final class SparseAccumulatorApplyGradient extends PrimitiveOp
Does not add if local_step is smaller than the accumulator's global_step.
operation
Modifier and Type | Method and Description |
---|---|
static <T> SparseAccumulatorApplyGradient |
create(Scope scope,
Operand<String> handle,
Operand<Long> localStep,
Operand<Long> gradientIndices,
Operand<T> gradientValues,
Operand<Long> gradientShape,
Boolean hasKnownShape)
Factory method to create a class wrapping a new SparseAccumulatorApplyGradient operation.
|
equals, hashCode, op, toString
public static <T> SparseAccumulatorApplyGradient create(Scope scope, Operand<String> handle, Operand<Long> localStep, Operand<Long> gradientIndices, Operand<T> gradientValues, Operand<Long> gradientShape, Boolean hasKnownShape)
scope
- current scopehandle
- The handle to a accumulator.localStep
- The local_step value at which the sparse gradient was computed.gradientIndices
- Indices of the sparse gradient to be accumulated. Must be a
vector.gradientValues
- Values are the non-zero slices of the gradient, and must have
the same first dimension as indices, i.e., the nnz represented by indices and
values must be consistent.gradientShape
- Shape of the sparse gradient to be accumulated.hasKnownShape
- Boolean indicating whether gradient_shape is unknown, in which
case the input is ignored during validation.Copyright © 2022. All rights reserved.