code: def t_softmax(
      input: Tensor, t: Tensor = None, dim: int = -1
  ) -> Tensor:
      if t is None:
          t = torch.tensor(0.5, device=input.device)
      assert (t >= 0.0).all()
      maxes = torch.max(input, dim=dim, keepdim=True).values
      input_minus_maxes = input - maxes
  
      w = torch.relu(input_minus_maxes + t) + 1e-8
      return torch.softmax(input_minus_maxes + torch.log(w), dim=dim)
  
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 a global function with example usage: t_softmax(input, t, dim) and returns: torch