class_docstr: Duration calculator module for FastSpeech.
  
  Todo:
      * Fix the duplicated calculation of diagonal head decision
class_docstr_tok: ["Duration","calculator","module","for","FastSpeech",".","Todo",":","*","Fix","the","duplicated","calculation","of","diagonal","head","decision"]
code: def _init_diagonal_head(self, att_ws):
      diagonal_scores = (
          att_ws.max(dim=-1)[0].mean(dim=-1).mean(dim=0)
      )  # (H * L,)
      self.register_buffer("diag_head_idx", diagonal_scores.argmax())
  
file_path: espnet/espnet/nets/pytorch_backend/fastspeech/duration_calculator.py
imports: import torch
  from espnet.nets.pytorch_backend.e2e_tts_tacotron2 import Tacotron2
  from espnet.nets.pytorch_backend.e2e_tts_transformer import Transformer
  from espnet.nets.pytorch_backend.nets_utils import pad_list
label_desc: Use image node_id 4 for calling the DurationCalculator obj's underlying member method code with example usage: obj._init_diagonal_head(att_ws) without return types