class_docstr: Tacotron-based loss for S2ST.
class_docstr_tok: ["Tacotron-based","loss","for","S2ST","."]
code: def __init__(
      self,
      weight: float = 1.0,
      loss_type: str = "L1+L2",
      use_masking: str2bool = True,
      use_weighted_masking: str2bool = False,
      bce_pos_weight: float = 20.0,
  ):
      super().__init__()
      assert check_argument_types()
      self.weight = weight
      self.loss_type = loss_type
      self.loss = Tacotron2Loss(
          use_masking=use_masking,
          use_weighted_masking=use_weighted_masking,
          bce_pos_weight=bce_pos_weight,
      )
  
file_path: espnet/espnet2/s2st/losses/tacotron_loss.py
imports: import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.s2st.losses.abs_loss import AbsS2STLoss
  from espnet2.utils.types import str2bool
  from espnet.nets.pytorch_backend.e2e_tts_tacotron2 import Tacotron2Loss
  from espnet.nets.pytorch_backend.nets_utils import to_device
label_desc: Use image node_id 1 to create a new S2STTacotron2Loss object from inherited base classes: AbsS2STLoss with example: obj = S2STTacotron2Loss(weight, loss_type, use_masking, use_weighted_masking, bce_pos_weight)