class_docstr: Feed Forward Transformer for TTS a.k.a. FastSpeech.
  
  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: ["Feed","Forward","Transformer","for","TTS","a.k.a",".","FastSpeech",".","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 _transfer_from_teacher(self, transferred_encoder_module):
      if transferred_encoder_module == "all":
          for (n1, p1), (n2, p2) in zip(
              self.encoder.named_parameters(),
              self.teacher.encoder.named_parameters(),
          ):
              assert (
                  n1 == n2
              ), "It seems that encoder structure is different."
              assert (
                  p1.shape == p2.shape
              ), "It seems that encoder size is different."
              p1.data.copy_(p2.data)
      elif transferred_encoder_module == "embed":
          student_shape = self.encoder.embed[0].weight.data.shape
          teacher_shape = self.teacher.encoder.embed[
              0
          ].weight.data.shape
          assert (
              student_shape == teacher_shape
          ), "It seems that embed dimension is different."
          self.encoder.embed[0].weight.data.copy_(
              self.teacher.encoder.embed[0].weight.data
          )
      else:
          raise NotImplementedError("Support only all or embed.")
  
imports: import logging
  import torch
  import torch.nn.functional
  from espnet.asr.asr_utils import get_model_conf, torch_load
  from espnet.nets.pytorch_backend.fastspeech.duration_calculator import DurationCalculator
  from espnet.nets.pytorch_backend.fastspeech.duration_predictor import DurationPredictor, DurationPredictorLoss
  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.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding, ScaledPositionalEncoding
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.initializer import initialize
  from espnet.nets.tts_interface import TTSInterface
  from espnet.utils.cli_utils import strtobool
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 11 for calling the FeedForwardTransformer obj's underlying member method code with example usage: obj._transfer_from_teacher(transferred_encoder_module) without return types