code: def entmax15(X, dim=-1, k=None):
      """1.5-entmax: normalizing sparse transform (a la softmax).
  
      Solves the optimization problem:
  
          max_p <x, p> - H_1.5(p)    s.t.    p >= 0, sum(p) == 1.
  
      where H_1.5(p) is the Tsallis alpha-entropy with alpha=1.5.
  
      Parameters
      ----------
      X : torch.Tensor
          The input tensor.
  
      dim : int
          The dimension along which to apply 1.5-entmax.
  
      k : int or None
          number of largest elements to partial-sort over. For optimal
          performance, should be slightly bigger than the expected number of
          nonzeros in the solution. If the solution is more than k-sparse,
          this function is recursively called with a 2*k schedule.
          If `None`, full sorting is performed from the beginning.
  
      Returns
      -------
      P : torch tensor, same shape as X
          The projection result, such that P.sum(dim=dim) == 1 elementwise.
      """
  
      return Entmax15Function.apply(X, dim, 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 8 for calling a global function with example usage: entmax15(X, dim, k) and returns: Entmax15Function