class_docstr: Duration predictor module.
  
  This is a module of duration predictor described
  in `FastSpeech: Fast, Robust and Controllable Text to Speech`_.
  The duration predictor predicts a duration of each frame in log domain
  from the hidden embeddings of encoder.
  
  .. _`FastSpeech: Fast, Robust and Controllable Text to Speech`:
      https://arxiv.org/pdf/1905.09263.pdf
  
  Note:
      The calculation domain of outputs is different
      between in `forward` and in `inference`. In `forward`,
      the outputs are calculated in log domain but in `inference`,
      those are calculated in linear domain.
docstr: Calculate forward propagation.
  
  Args:
      xs (Tensor): Batch of input sequences (B, Tmax, idim).
      x_masks (ByteTensor, optional):
          Batch of masks indicating padded part (B, Tmax).
  
  Returns:
      Tensor: Batch of predicted durations in log domain (B, Tmax).
code: def forward(self, xs, x_masks=None):
      """Calculate forward propagation.
  
      Args:
          xs (Tensor): Batch of input sequences (B, Tmax, idim).
          x_masks (ByteTensor, optional):
              Batch of masks indicating padded part (B, Tmax).
  
      Returns:
          Tensor: Batch of predicted durations in log domain (B, Tmax).
  
      """
      return self._forward(xs, x_masks, False)
  
file_path: espnet/espnet/nets/pytorch_backend/fastspeech/duration_predictor.py
imports: import torch
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
label_desc: Use image node_id 3 for calling the DurationPredictor obj's underlying member method code with example usage: obj.forward(xs, x_masks) and returns: self