class_docstr: A highly optimized equivalent of labda x: Entmax15([x, 0])
class_docstr_tok: ["A","highly","optimized","equivalent","of","labda","x",":","Entmax15","(","[","x",",","0","]",")"]
code: def _forward(input):
      input, is_pos = abs(input), input >= 0
      tau = (input + torch.sqrt(F.relu(8 - input**2))) / 2
      tau.masked_fill_(tau <= input, 2.0)
      y_neg = 0.25 * F.relu(tau - input, inplace=True) ** 2
      return torch.where(is_pos, 1 - y_neg, y_neg)
  
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 2 for calling the Entmoid15 obj's underlying member method code with example usage: obj._forward(input) and returns: torch