code: def backward(ctx, grad_output):
      supp_size, output = ctx.saved_tensors
      dim = ctx.dim
      grad_input = grad_output.clone()
      grad_input[output == 0] = 0
  
      v_hat = (
          grad_input.sum(dim=dim) / supp_size.to(output.dtype).squeeze()
      )
      v_hat = v_hat.unsqueeze(dim)
      grad_input = torch.where(
          output != 0, grad_input - v_hat, grad_input
      )
      return grad_input, None
  
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 SparsemaxFunction obj's underlying member method code with example usage: obj.backward(ctx, grad_output) and returns: grad_input,  None