code: def test_dist_opt_spars_topk(self):
      # Test the C++ TopK based sparsification operation for all reduce
  
      param.set_value(10)
      grad.set_value(1)
  
      sgd.sparsification(
          grad.data, accumulation=None, spars=1, topK=True
      )
      sgd.wait()
      sgd.update(param, grad)
  
      np.testing.assert_array_almost_equal(
          tensor.to_numpy(param), expected, decimal=5
      )
  
file_path: singa/test/python/test_dist.py
imports: import unittest
  import numpy
  from singa import tensor
  from singa import opt
  from singa import device
  from singa import singa_wrap
label_desc: Use image node_id 6 for calling the TestDistOptimizer obj's underlying member method code with example usage: obj.test_dist_opt_spars_topk() without return types