code: def __init__(self, dim=-1):
      self.dim = dim
      super(Sparsemax, self).__init__()
  
imports: from torch import nn
  from torch.autograd import Function
  import torch.nn.functional
  import torch
label_desc: Use image node_id 1 to create a new Sparsemax object from inherited base classes: nn with example: obj = Sparsemax(dim)