code: def testAddSparseDense(self):
      np.random.seed(1618)  # Make it reproducible.
      n, m = np.random.randint(30, size=2)
      for dtype in [np.float32, np.float64, np.int64, np.complex64]:
          for index_dtype in [np.int32, np.int64]:
              rand_vals_np = np.random.randn(n, m).astype(dtype)
              dense_np = np.random.randn(n, m).astype(dtype)
  
              with test_util.force_cpu():
                  sparse, unused_nnz = _sparsify(
                      rand_vals_np, index_dtype=index_dtype
                  )
                  s = self.evaluate(
                      sparse_ops.sparse_add(
                          sparse, constant_op.constant(dense_np)
                      )
                  )
                  self.assertAllEqual(dense_np + rand_vals_np, s)
                  self.assertTrue(s.dtype == dtype)
  
                  # check commutativity
                  s = self.evaluate(
                      sparse_ops.sparse_add(
                          constant_op.constant(dense_np), sparse
                      )
                  )
                  self.assertAllEqual(dense_np + rand_vals_np, s)
                  self.assertTrue(s.dtype == dtype)
  
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 9 for calling the SparseAddTest obj's underlying member method code with example usage: obj.testAddSparseDense() without return types