code: def testGradients(self):
      np.random.seed(1618)  # Make it reproducible.
      with self.session(use_gpu=False):
          for n in [10, 31]:
              for m in [4, 17]:
                  sp_a, nnz_a = self._randomTensor([n, m], np.float32)
                  sp_b, nnz_b = self._randomTensor([n, m], np.float32)
                  sp_sum = sparse_ops.sparse_add(sp_a, sp_b)
                  nnz_sum = len(self.evaluate(sp_sum.values))
  
                  err = gradient_checker.compute_gradient_error(
                      [sp_a.values, sp_b.values],
                      [(nnz_a,), (nnz_b,)],
                      sp_sum.values,
                      (nnz_sum,),
                  )
                  self.assertLess(err, 1e-3)
  
imports: import timeit
  import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sparse_ops
  import tensorflow.python.ops.sparse_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 8 for calling the SparseAddTest obj's underlying member method code with example usage: obj.testGradients() without return types