class_docstr: Guided attention loss function module for multi head attention.
  
  Args:
      sigma (float, optional): Standard deviation to control
      how close attention to a diagonal.
      alpha (float, optional): Scaling coefficient (lambda).
      reset_always (bool, optional): Whether to always reset masks.
class_docstr_tok: ["Guided","attention","loss","function","module","for","multi","head","attention",".","Args",":","sigma","(","float",",","optional",")",":","Standard","deviation","to","control","how","close","attention","to","a","diagonal",".","alpha","(","float",",","optional",")",":","Scaling","coefficient","(","lambda",")",".","reset_always","(","bool",",","optional",")",":","Whether","to","always","reset","masks","."]
docstr: Calculate forward propagation.
  
  Args:
      att_ws (Tensor):
          Batch of multi head attention weights (B, H, T_max_out, T_max_in).
      ilens (LongTensor): Batch of input lengths (B,).
      olens (LongTensor): Batch of output lengths (B,).
  
  Returns:
      Tensor: Guided attention loss value.
docstr_tok: ["Calculate","forward","propagation",".","Args",":","att_ws","(","Tensor",")",":","Batch","of","multi","head","attention","weights","(","B",",","H",",","T_max_out",",","T_max_in",")",".","ilens","(","LongTensor",")",":","Batch","of","input","lengths","(","B",",",")",".","olens","(","LongTensor",")",":","Batch","of","output","lengths","(","B",",",")",".","Returns",":","Tensor",":","Guided","attention","loss","value","."]
code: def forward(self, att_ws, ilens, olens):
      """Calculate forward propagation.
  
      Args:
          att_ws (Tensor):
              Batch of multi head attention weights (B, H, T_max_out, T_max_in).
          ilens (LongTensor): Batch of input lengths (B,).
          olens (LongTensor): Batch of output lengths (B,).
  
      Returns:
          Tensor: Guided attention loss value.
  
      """
      if self.guided_attn_masks is None:
          self.guided_attn_masks = (
              self._make_guided_attention_masks(ilens, olens)
              .to(att_ws.device)
              .unsqueeze(1)
          )
      if self.masks is None:
          self.masks = (
              self._make_masks(ilens, olens)
              .to(att_ws.device)
              .unsqueeze(1)
          )
      losses = self.guided_attn_masks * att_ws
      loss = torch.mean(losses.masked_select(self.masks))
      if self.reset_always:
          self._reset_masks()
  
      return self.alpha * loss
  
imports: import logging
  import torch
  import torch.nn.functional
  from espnet.nets.pytorch_backend.e2e_tts_tacotron2 import GuidedAttentionLoss
  from espnet.nets.pytorch_backend.e2e_tts_tacotron2 import Tacotron2Loss
  from espnet.nets.pytorch_backend.nets_utils import make_non_pad_mask
  from espnet.nets.pytorch_backend.tacotron2.decoder import Postnet
  from espnet.nets.pytorch_backend.tacotron2.decoder import Prenet
  from espnet.nets.pytorch_backend.tacotron2.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.decoder import Decoder
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding, ScaledPositionalEncoding
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.initializer import initialize
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask
  from espnet.nets.tts_interface import TTSInterface
  from espnet.utils.cli_utils import strtobool
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 1 for calling the GuidedMultiHeadAttentionLoss obj's underlying member method code with example usage: obj.forward(att_ws, ilens, olens) and returns: unknown