Link Search Menu Expand Document

SparseAddGrad


tensorflow C++ API

tensorflow::ops::SparseAddGrad

The gradient operator for the SparseAdd op.


Summary

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.

Arguments:

  • scope: A Scope object
  • backprop_val_grad: 1-D with shape [nnz(sum)]. The gradient with respect to the non-empty values of the sum.
  • a_indices: 2-D. The indices of the SparseTensor A, size [nnz(A), ndims].
  • b_indices: 2-D. The indices of the SparseTensor B, size [nnz(B), ndims].
  • sum_indices: 2-D. The indices of the sum SparseTensor, size [nnz(sum), ndims].

Returns:

  • Output a_val_grad: 1-D with shape [nnz(A)]. The gradient with respect to the non-empty values of A.
  • Output b_val_grad: 1-D with shape [nnz(B)]. The gradient with respect to the non-empty values of B.

SparseAddGrad block

Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_sparse.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • Input backprop_val_grad: connect Input node.
  • Input a_indices: connect Input node.
  • Input b_indices: connect Input node.
  • Input sum_indices: connect Input node.

Return:

  • Output a_val_grad: Output object of SparseAdd class object.
  • Output b_val_grad: Output object of SparseAdd class object.

Result:

  • std::vector(Tensor) product_result : Returned object of executed result by calling session.

Using Method

*SparseAdd 노드 생성방법은 SparseAdd 페이지에 기재되어 있음.