code: def _SparseMatrixAddGrad(op: ops.Operation, grad):
      """Gradient for sparse_matrix_add op."""
      # input to sparse_matrix_add is (a, b, alpha, beta)
      # with a, b CSR and alpha beta scalars.
      # output is: alpha * a + beta * b
  
      # d(a*A + b*B)/dA . grad = a * grad
  
      # May have gotten the transposes wrong below.
      # d(a*A + b*B)/da . grad = tr(A' . grad)
  
      # For now, only implement gradients w.r.t. A and B.
      # TODO(ebrevdo): Implement reduce_sum for SparseMatrix so that we
      # can implement gradients w.r.t. a and b.
      (a_csr, b_csr, alpha, beta) = op.inputs
      return (
          sparse_csr_matrix_ops.sparse_matrix_mul(
              _PruneCSRMatrix(grad, a_csr), alpha
          ),
          sparse_csr_matrix_ops.sparse_matrix_mul(
              _PruneCSRMatrix(grad, b_csr), beta
          ),
          None,
          None,
      )
  
file_path: tensorflow-upstream/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py
imports: from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
label_desc: Use image node_id 7 for calling a global function with example usage: _SparseMatrixAddGrad(op, grad) and returns: sparse_csr_matrix_ops,  sparse_csr_matrix_ops,  None,  None