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_encoder_decoder_attentions(
      self, xs, ilens, ys, olens, spembs=None
  ):
      att_dict = self.teacher_model.calculate_all_attentions(
          xs,
          ilens,
          ys,
          olens,
          spembs=spembs,
          skip_output=True,
          keep_tensor=True,
      )
      return torch.cat(
          [att_dict[k] for k in att_dict.keys() if "src_attn" in k],
          dim=1,
      )
  
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 5 for calling the DurationCalculator obj's underlying member method code with example usage: obj._calculate_encoder_decoder_attentions(xs, ilens, ys, olens, spembs) and returns: torch