class_docstr: Style encoder.
  
  This module is style encoder introduced in `Style Tokens: Unsupervised Style
  Modeling, Control and Transfer in End-to-End Speech Synthesis`.
  
  .. _`Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End
      Speech Synthesis`: https://arxiv.org/abs/1803.09017
  
  Args:
      idim (int, optional): Dimension of the input mel-spectrogram.
      gst_tokens (int, optional): The number of GST embeddings.
      gst_token_dim (int, optional): Dimension of each GST embedding.
      gst_heads (int, optional): The number of heads in GST multihead attention.
      conv_layers (int, optional): The number of conv layers in the reference encoder.
      conv_chans_list: (Sequence[int], optional):
          List of the number of channels of conv layers in the referece encoder.
      conv_kernel_size (int, optional):
          Kernel size of conv layers in the reference encoder.
      conv_stride (int, optional):
          Stride size of conv layers in the reference encoder.
      gru_layers (int, optional): The number of GRU layers in the reference encoder.
      gru_units (int, optional): The number of GRU units in the reference encoder.
  
  Todo:
      * Support manual weight specification in inference.
class_docstr_tok: ["Style","encoder",".","This","module","is","style","encoder","introduced","in","`","Style","Tokens",":","Unsupervised","Style","Modeling",",","Control","and","Transfer","in","End-to-End","Speech","Synthesis","`",".","..","_","`","Style","Tokens",":","Unsupervised","Style","Modeling",",","Control","and","Transfer","in","End-to-End","Speech","Synthesis","`",":","https",":","\/\/arxiv.org\/abs\/1803.09017","Args",":","idim","(","int",",","optional",")",":","Dimension","of","the","input","mel-spectrogram",".","gst_tokens","(","int",",","optional",")",":","The","number","of","GST","embeddings",".","gst_token_dim","(","int",",","optional",")",":","Dimension","of","each","GST","embedding",".","gst_heads","(","int",",","optional",")",":","The","number","of","heads","in","GST","multihead","attention",".","conv_layers","(","int",",","optional",")",":","The","number","of","conv","layers","in","the","reference","encoder",".","conv_chans_list",":","(","Sequence","[","int","]",",","optional",")",":","List","of","the","number","of","channels","of","conv","layers","in","the","referece","encoder",".","conv_kernel_size","(","int",",","optional",")",":","Kernel","size","of","conv","layers","in","the","reference","encoder",".","conv_stride","(","int",",","optional",")",":","Stride","size","of","conv","layers","in","the","reference","encoder",".","gru_layers","(","int",",","optional",")",":","The","number","of","GRU","layers","in","the","reference","encoder",".","gru_units","(","int",",","optional",")",":","The","number","of","GRU","units","in","the","reference","encoder",".","Todo",":","*","Support","manual","weight","specification","in","inference","."]
docstr: Initilize global style encoder module.
docstr_tok: ["Initilize","global","style","encoder","module","."]
code: def __init__(
      self,
      idim: int = 80,
      gst_tokens: int = 10,
      gst_token_dim: int = 256,
      gst_heads: int = 4,
      conv_layers: int = 6,
      conv_chans_list: Sequence[int] = (32, 32, 64, 64, 128, 128),
      conv_kernel_size: int = 3,
      conv_stride: int = 2,
      gru_layers: int = 1,
      gru_units: int = 128,
  ):
      """Initilize global style encoder module."""
      assert check_argument_types()
      super(StyleEncoder, self).__init__()
  
      self.ref_enc = ReferenceEncoder(
          idim=idim,
          conv_layers=conv_layers,
          conv_chans_list=conv_chans_list,
          conv_kernel_size=conv_kernel_size,
          conv_stride=conv_stride,
          gru_layers=gru_layers,
          gru_units=gru_units,
      )
      self.stl = StyleTokenLayer(
          ref_embed_dim=gru_units,
          gst_tokens=gst_tokens,
          gst_token_dim=gst_token_dim,
          gst_heads=gst_heads,
      )
  
file_path: espnet/espnet2/tts/gst/style_encoder.py
imports: from typing import Sequence
  import torch
  from typeguard import check_argument_types
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
label_desc: Use image node_id 1 to create a new StyleEncoder object from inherited base classes: torch.nn with example: obj = StyleEncoder(idim, gst_tokens, gst_token_dim, gst_heads, conv_layers, conv_chans_list, conv_kernel_size, conv_stride, gru_layers, gru_units)