class_docstr: Flatten-T Swish activation definition.
  
  FTSwish(x) = x * sigmoid(x) + threshold
                where FTSwish(x) < 0 = threshold
  
  Reference: https://arxiv.org/abs/1812.06247
  
  Args:
      threshold: Threshold value for FTSwish activation formulation. (threshold < 0)
      mean_shift: Mean shifting value for FTSwish activation formulation.
                     (applied only if != 0, disabled by default)
class_docstr_tok: ["Flatten-T","Swish","activation","definition",".","FTSwish","(","x",")","=","x","*","sigmoid","(","x",")","+","threshold","where","FTSwish","(","x",")","<","0","=","threshold","Reference",":","https",":","\/\/arxiv.org\/abs\/1812.06247","Args",":","threshold",":","Threshold","value","for","FTSwish","activation","formulation",".","(","threshold","<","0",")","mean_shift",":","Mean","shifting","value","for","FTSwish","activation","formulation",".","(","applied","only","if","!","=","0",",","disabled","by","default",")"]
docstr: Forward computation.
docstr_tok: ["Forward","computation","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """Forward computation."""
      x = (x * torch.sigmoid(x)) + self.threshold
      x = torch.where(
          x >= 0, x, torch.tensor([self.threshold], device=x.device)
      )
  
      if self.mean_shift != 0:
          x.sub_(self.mean_shift)
  
      return x
  
file_path: espnet/espnet2/asr_transducer/activation.py
imports: import torch
  from packaging.version import parse
label_desc: Use image node_id 2 for calling the FTSwish obj's underlying member method code with example usage: obj.forward(x) and returns: x