code: def test_sparsemax_loss_constructor_not_from_logits(dtype):
      """check sparsemax-loss construcor throws when from_logits=True."""
      with pytest.raises(ValueError):
          SparsemaxLoss(from_logits=False)
  
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 7 for calling a global function with example usage: test_sparsemax_loss_constructor_not_from_logits(dtype) without return types