T
- data type for aValGrad()
output@Operator(group="sparse") public final class SparseAddGrad<T> extends PrimitiveOp
The SparseAdd op calculates A + B, where A, B, and the sum are all represented as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. non-empty values of the sum, and outputs the gradients w.r.t. the non-empty values of A and B.
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
aValGrad()
1-D with shape `[nnz(A)]`.
|
Output<T> |
bValGrad()
1-D with shape `[nnz(B)]`.
|
static <T> SparseAddGrad<T> |
create(Scope scope,
Operand<T> backpropValGrad,
Operand<Long> aIndices,
Operand<Long> bIndices,
Operand<Long> sumIndices)
Factory method to create a class wrapping a new SparseAddGrad operation.
|
equals, hashCode, op, toString
public static <T> SparseAddGrad<T> create(Scope scope, Operand<T> backpropValGrad, Operand<Long> aIndices, Operand<Long> bIndices, Operand<Long> sumIndices)
scope
- current scopebackpropValGrad
- 1-D with shape `[nnz(sum)]`. The gradient with respect to
the non-empty values of the sum.aIndices
- 2-D. The `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`.bIndices
- 2-D. The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`.sumIndices
- 2-D. The `indices` of the sum `SparseTensor`, size
`[nnz(sum), ndims]`.public Output<T> aValGrad()
Copyright © 2022. All rights reserved.