code: def forward(self, input):
      return sparsemax(input, self.dim)
  
file_path: OpenNMT-py/onmt/modules/sparse_activations.py
imports: import torch
  from torch.autograd import Function
  from torch.cuda.amp import custom_fwd, custom_bwd
  import torch.nn
label_desc: Use image node_id 2 for calling the Sparsemax obj's underlying member method code with example usage: obj.forward(input) and returns: sparsemax