Stay organized with collections
Save and categorize content based on your preferences.
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.
Public attributes
Public functions
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-08-16 UTC.
[null,null,["Last updated 2021-08-16 UTC."],[],[],null,["# tensorflow::ops::SparseAddGrad Class Reference\n\ntensorflow::\nops::\nSparseAddGrad\n================================\n\n`\n#include \u003csparse_ops.h\u003e\n`\n\n\nThe gradient operator for the\n[SparseAdd](/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-add#classtensorflow_1_1ops_1_1_sparse_add)\nop.\n\nSummary\n-------\n\n\nThe\n[SparseAdd](/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-add#classtensorflow_1_1ops_1_1_sparse_add)\nop calculates A + B, where A, B, and the sum are all represented as\n`\nSparseTensor\n`\nobjects. 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.\n\n\nArgs:\n\n- scope: A [Scope](/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- backprop_val_grad: 1-D with shape `\n [nnz(sum)]\n ` . The gradient with respect to the non-empty values of the sum.\n- a_indices: 2-D. The `\n indices\n ` of the `\n SparseTensor\n ` A, size `\n [nnz(A), ndims]\n ` .\n- b_indices: 2-D. The `\n indices\n ` of the `\n SparseTensor\n ` B, size `\n [nnz(B), ndims]\n ` .\n- sum_indices: 2-D. The `\n indices\n ` of the sum `\n SparseTensor\n ` , size `\n [nnz(sum), ndims]\n ` .\n\n\u003cbr /\u003e\n\n\nReturns:\n\n- `\n `[Output](/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output)`\n ` a_val_grad: 1-D with shape `\n [nnz(A)]\n ` . The gradient with respect to the non-empty values of A.\n- `\n `[Output](/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output)`\n ` b_val_grad: 1-D with shape `\n [nnz(B)]\n ` . The gradient with respect to the non-empty values of B.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| ` `[SparseAddGrad](#classtensorflow_1_1ops_1_1_sparse_add_grad_1abbcde91fb7e908ec0479c7f47b13e1c5)` (const :: `[tensorflow::Scope](/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` backprop_val_grad, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a_indices, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_indices, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sum_indices) ` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| ` `[a_val_grad](#classtensorflow_1_1ops_1_1_sparse_add_grad_1a93a1ecb35e9a570a0ce07d6b64c378d3)` ` | ` :: `[tensorflow::Output](/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output)` ` |\n| ` `[b_val_grad](#classtensorflow_1_1ops_1_1_sparse_add_grad_1a89ccb278507678ca1a3ac465ccdf2613)` ` | ` :: `[tensorflow::Output](/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output)` ` |\n| ` `[operation](#classtensorflow_1_1ops_1_1_sparse_add_grad_1a0ae3fb6459f86ab238ee9d3705c33994)` ` | ` `[Operation](/versions/r2.6/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation)` ` |\n\nPublic attributes\n-----------------\n\n### a_val_grad\n\n```scdoc\n::tensorflow::Output a_val_grad\n``` \n\n### b_val_grad\n\n```scdoc\n::tensorflow::Output b_val_grad\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### SparseAddGrad\n\n```gdscript\n SparseAddGrad(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input backprop_val_grad,\n ::tensorflow::Input a_indices,\n ::tensorflow::Input b_indices,\n ::tensorflow::Input sum_indices\n)\n```"]]