class_docstr: Non-attention Tacotron:
      - https://arxiv.org/abs/2010.04301
  this source code is implemenation of the ExpressiveTacotron from BridgetteSong
      - https://github.com/BridgetteSong/ExpressiveTacotron/
class_docstr_tok: ["Non-attention","Tacotron",":","-","https",":","\/\/arxiv.org\/abs\/2010.04301","this","source","code","is","implemenation","of","the","ExpressiveTacotron","from","BridgetteSong","-","https",":","\/\/github.com\/BridgetteSong\/ExpressiveTacotron\/"]
code: def get_mask_from_lengths(self, lengths, max_len=None):
      if max_len is None:
          max_len = max(lengths)
      ids = np.arange(0, max_len)
      mask = ids < lengths.reshape(-1, 1)
      return mask
  
imports: import logging
  from typing import Dict, Optional, Sequence, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.s2st.synthesizer.abs_synthesizer import AbsSynthesizer
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet2.torch_utils.initialize import initialize
  from espnet2.tts.fastspeech2.loss import FastSpeech2Loss
  from espnet2.tts.fastspeech2.variance_predictor import VariancePredictor
  from espnet2.tts.gst.style_encoder import StyleEncoder
  from espnet.nets.pytorch_backend.conformer.encoder import Encoder
  from espnet.nets.pytorch_backend.fastspeech.duration_predictor import DurationPredictor
  from espnet.nets.pytorch_backend.fastspeech.length_regulator import LengthRegulator
  from espnet.nets.pytorch_backend.nets_utils import make_non_pad_mask, make_pad_mask
  from espnet.nets.pytorch_backend.tacotron2.decoder import Postnet
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding, ScaledPositionalEncoding
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
label_desc: Use image node_id 3 for calling the GaussianUpsampling obj's underlying member method code with example usage: obj.get_mask_from_lengths(lengths, max_len) and returns: mask