code: def forward(cls, ctx, X, dim=-1, k=None):
      ctx.dim = dim
      output, backwards_kwargs = _sparsemax_forward(X, dim, k)
      ctx.save_for_backward(backwards_kwargs["supp_size"], output)
      return output
  
imports: import torch
  import torch.nn
  from torch.autograd import Function
label_desc: Use image node_id 1 for calling the SparsemaxFunction obj's underlying member method code with example usage: obj.forward(cls, ctx, X, dim, k) and returns: output