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 _calculate_duration(att_w, ilen, olen):
      return torch.stack(
          [
              att_w[:olen, :ilen].argmax(-1).eq(i).sum()
              for i in range(ilen)
          ]
      )
  
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 3 for calling the DurationCalculator obj's underlying member method code with example usage: obj._calculate_duration(att_w, ilen, olen) and returns: torch