class_docstr: Referance encoder for utterance and phoneme prosody encoders. Reference encoder
  made up of convolution and RNN layers.
  
  Args:
      num_mels (int): Number of mel frames to produce.
      ref_enc_filters (list[int]): List of channel sizes for encoder layers.
      ref_enc_size (int): Size of the kernel for the conv layers.
      ref_enc_strides (List[int]): List of strides to use for conv layers.
      ref_enc_gru_size (int): Number of hidden features for the gated recurrent unit.
  
  Inputs: inputs, mask
      - **inputs** (batch, dim, time): Tensor containing mel vector
      - **lengths** (batch): Tensor containing the mel lengths.
  Returns:
      - **outputs** (batch, time, dim): Tensor produced by Reference Encoder.
code: def __init__(
      self,
      num_mels: int,
      ref_enc_filters: List[Union[int, int, int, int, int, int]],
      ref_enc_size: int,
      ref_enc_strides: List[Union[int, int, int, int, int]],
      ref_enc_gru_size: int,
  ):
      super().__init__()
  
      n_mel_channels = num_mels
      self.n_mel_channels = n_mel_channels
      K = len(ref_enc_filters)
      filters = [self.n_mel_channels] + ref_enc_filters
      strides = [1] + ref_enc_strides
      # Use CoordConv at the first layer to better preserve positional information: https://arxiv.org/pdf/1811.02122.pdf
      convs = [
          CoordConv1d(
              in_channels=filters[0],
              out_channels=filters[0 + 1],
              kernel_size=ref_enc_size,
              stride=strides[0],
              padding=ref_enc_size // 2,
              with_r=True,
          )
      ]
      convs2 = [
          nn.Conv1d(
              in_channels=filters[i],
              out_channels=filters[i + 1],
              kernel_size=ref_enc_size,
              stride=strides[i],
              padding=ref_enc_size // 2,
          )
          for i in range(1, K)
      ]
      convs.extend(convs2)
      self.convs = nn.ModuleList(convs)
  
      self.norms = nn.ModuleList(
          [
              nn.InstanceNorm1d(
                  num_features=ref_enc_filters[i], affine=True
              )
              for i in range(K)
          ]
      )
  
      self.gru = nn.GRU(
          input_size=ref_enc_filters[-1],
          hidden_size=ref_enc_gru_size,
          batch_first=True,
      )
  
imports: from typing import List, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from TTS.tts.layers.delightful_tts.conformer import ConformerMultiHeadedSelfAttention
  from TTS.tts.layers.delightful_tts.conv_layers import CoordConv1d
  from TTS.tts.layers.delightful_tts.networks import STL
label_desc: Use image node_id 1 to create a new ReferenceEncoder object from inherited base classes: nn with example: obj = ReferenceEncoder(num_mels, ref_enc_filters, ref_enc_size, ref_enc_strides, ref_enc_gru_size)