code: def forward(self, X):
      return sparsemax(X, dim=self.dim, k=self.k)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from torch.autograd import Function
  from torch.jit import script
label_desc: Use image node_id 2 for calling the Sparsemax obj's underlying member method code with example usage: obj.forward(X) and returns: sparsemax