code: def sparsemax_loss_from_logits(
      y_true: TensorLike, logits_pred: TensorLike
  ) -> tf.Tensor:
      y_pred = sparsemax(logits_pred)
      loss = sparsemax_loss(logits_pred, y_pred, y_true)
      return loss
  
file_path: addons/tensorflow_addons/losses/sparsemax_loss.py
imports: import tensorflow
  from tensorflow_addons.activations.sparsemax import sparsemax
  from tensorflow_addons.utils.types import TensorLike
  from typeguard import typechecked
  from typing import Optional
label_desc: Use image node_id 2 for calling a global function with example usage: sparsemax_loss_from_logits(y_true, logits_pred) and returns: loss