code: def test_constant_add(dtype):
      """check sparsemax-loss proposition 3."""
      random = np.random.RandomState(4)
  
      z = random.uniform(low=-3, high=3, size=(test_obs, 10))
      c = random.uniform(low=-3, high=3, size=(test_obs, 1))
      q = np.zeros((test_obs, 10))
      q[
          np.arange(0, test_obs),
          np.random.randint(0, 10, size=test_obs),
      ] = 1
  
      _, tf_loss_zpc = _tf_sparsemax_loss(z + c, q, dtype)
      _, tf_loss_z = _tf_sparsemax_loss(z, q, dtype)
  
      test_utils.assert_allclose_according_to_type(
          tf_loss_zpc, tf_loss_z, float_atol=5e-6, float_rtol=5e-6
      )
  
file_path: addons/tensorflow_addons/losses/tests/sparsemax_loss_test.py
imports: import pytest
  from packaging.version import Version
  import tensorflow
  import numpy
  from tensorflow_addons.activations import sparsemax
  from tensorflow_addons.losses import sparsemax_loss, SparsemaxLoss
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 11 for calling a global function with example usage: test_constant_add(dtype) without return types