class_docstr: Sparsemax activation function.
  
  The output shape is the same as the input shape.
  
  See [From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification](https://arxiv.org/abs/1602.02068).
  
  Args:
      axis: Integer, axis along which the sparsemax normalization is applied.
code: def __init__(self, axis: int = -1, **kwargs):
      super().__init__(**kwargs)
      self.supports_masking = True
      self.axis = axis
  
file_path: addons/tensorflow_addons/layers/sparsemax.py
imports: import tensorflow
  from tensorflow_addons.activations.sparsemax import sparsemax
  from typeguard import typechecked
label_desc: Use image node_id 1 to create a new Sparsemax object from inherited base classes: tf.keras.layers with example: obj = Sparsemax(axis)