tensorflow::ops::SparseAddGrad

#include <sparse_ops.h>

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.

Args:

  • 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.

Constructors and Destructors

SparseAddGrad(const ::tensorflow::Scope & scope, ::tensorflow::Input backprop_val_grad, ::tensorflow::Input a_indices, ::tensorflow::Input b_indices, ::tensorflow::Input sum_indices)

Public attributes

a_val_grad
b_val_grad
operation

Public attributes

a_val_grad

::tensorflow::Output a_val_grad

b_val_grad

::tensorflow::Output b_val_grad

operation

Operation operation

Public functions

SparseAddGrad

 SparseAddGrad(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input backprop_val_grad,
  ::tensorflow::Input a_indices,
  ::tensorflow::Input b_indices,
  ::tensorflow::Input sum_indices
)