code: def test_gradient_against_estimate(dtype):
      """check sparsemax Rop, against estimated Rop."""
      random = np.random.RandomState(9)
  
      # sparsemax is not a smooth function so gradient estimation is only
      # possible for float64.
      if dtype != "float64":
          return
  
      z = random.uniform(low=-1, high=1, size=(test_obs, 10)).astype(
          dtype
      )
  
      (jacob_sym,), (jacob_num,) = tf.test.compute_gradient(
          lambda logits: sparsemax(logits), [z], delta=1e-6
      )
      np.testing.assert_allclose(jacob_sym, jacob_num)
  
file_path: addons/tensorflow_addons/activations/tests/sparsemax_test.py
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.activations import sparsemax
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 14 for calling a global function with example usage: test_gradient_against_estimate(dtype) without return types