code: def test_diffrence(dtype):
      """check sparsemax proposition 4."""
      random = np.random.RandomState(7)
  
      z = random.uniform(low=-3, high=3, size=(test_obs, 10))
      p = sparsemax(z.astype(dtype)).numpy()
  
      etol = {np.float32: 1e-6, np.float64: 1e-9}[dtype]
  
      for val in range(0, test_obs):
          for i in range(0, 10):
              for j in range(0, 10):
                  # check condition, the obesite pair will be checked anyway
                  if z[val, i] > z[val, j]:
                      continue
  
                  assert (
                      0
                      <= p[val, j] - p[val, i]
                      <= z[val, j] - z[val, i] + etol
                  )
  
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 12 for calling a global function with example usage: test_diffrence(dtype) without return types