#include <sparse_ops.h>
The gradient operator for the SparseAdd op.
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:
[nnz(sum)]
. The gradient with respect to the non-empty values of the sum.indices
of the SparseTensor
A, size [nnz(A), ndims]
.indices
of the SparseTensor
B, size [nnz(B), ndims]
.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 |
::tensorflow::Output a_val_grad
::tensorflow::Output b_val_grad
SparseAddGrad( const ::tensorflow::Scope & scope, ::tensorflow::Input backprop_val_grad, ::tensorflow::Input a_indices, ::tensorflow::Input b_indices, ::tensorflow::Input sum_indices )
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/sparse-add-grad.html