class_docstr: An implementation of exact Entmax with alpha=1.5 (B. Peters, V. Niculae, A. Martins). See
  :cite:`https://arxiv.org/abs/1905.05702 for detailed description.
  Source: https://github.com/deep-spin/entmax
code: def _threshold_and_support(input, dim=-1):
      Xsrt, _ = torch.sort(input, descending=True, dim=dim)
  
      rho = _make_ix_like(input, dim)
      mean = Xsrt.cumsum(dim) / rho
      mean_sq = (Xsrt**2).cumsum(dim) / rho
      ss = rho * (mean_sq - mean**2)
      delta = (1 - ss) / rho
  
      # NOTE this is not exactly the same as in reference algo
      # Fortunately it seems the clamped values never wrongly
      # get selected by tau <= sorted_z. Prove this!
      delta_nz = torch.clamp(delta, 0)
      tau = mean - torch.sqrt(delta_nz)
  
      support_size = (tau <= Xsrt).sum(dim).unsqueeze(dim)
      tau_star = tau.gather(dim, support_size - 1)
      return tau_star, support_size
  
imports: from torch import nn
  from torch.autograd import Function
  import torch.nn.functional
  import torch
label_desc: Use image node_id 3 for calling the Entmax15Function obj's underlying member method code with example usage: obj._threshold_and_support(input, dim) and returns: tau_star,  support_size