class_docstr: FastSpeech module for end-to-end text-to-speech.
  
  This is a module of FastSpeech, feed-forward Transformer with duration predictor
  described in `FastSpeech: Fast, Robust and Controllable Text to Speech`_, which
  does not require any auto-regressive processing during inference, resulting in
  fast decoding compared with auto-regressive Transformer.
  
  .. _`FastSpeech: Fast, Robust and Controllable Text to Speech`:
      https://arxiv.org/pdf/1905.09263.pdf
class_docstr_tok: ["FastSpeech","module","for","end-to-end","text-to-speech",".","This","is","a","module","of","FastSpeech",",","feed-forward","Transformer","with","duration","predictor","described","in","`","FastSpeech",":","Fast",",","Robust","and","Controllable","Text","to","Speech","`","_",",","which","does","not","require","any","auto-regressive","processing","during","inference",",","resulting","in","fast","decoding","compared","with","auto-regressive","Transformer",".","..","_","`","FastSpeech",":","Fast",",","Robust","and","Controllable","Text","to","Speech","`",":","https",":","\/\/arxiv.org\/pdf\/1905.09263.pdf"]
code: def _reset_parameters(
      self, init_type: str, init_enc_alpha: float, init_dec_alpha: float
  ):
      # initialize parameters
      if init_type != "pytorch":
          initialize(self, init_type)
  
      # initialize alpha in scaled positional encoding
      if self.encoder_type == "transformer" and self.use_scaled_pos_enc:
          self.encoder.embed[-1].alpha.data = torch.tensor(
              init_enc_alpha
          )
      if self.decoder_type == "transformer" and self.use_scaled_pos_enc:
          self.decoder.embed[-1].alpha.data = torch.tensor(
              init_dec_alpha
          )
  
imports: import logging
  from typing import Dict, Optional, Sequence, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet2.torch_utils.initialize import initialize
  from espnet2.tts.abs_tts import AbsTTS
  from espnet2.tts.gst.style_encoder import StyleEncoder
  from espnet.nets.pytorch_backend.conformer.encoder import Encoder
  from espnet.nets.pytorch_backend.e2e_tts_fastspeech import FeedForwardTransformerLoss
  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 7 for calling the FastSpeech obj's underlying member method code with example usage: obj._reset_parameters(init_type, init_enc_alpha, init_dec_alpha) without return types