class_docstr: Postnet Module.
  
  Args:
      n_mels (int): Number of mel bins.
      postnet_embedding_dim (int): Postnet embedding dimension.
      postnet_kernel_size (int): Postnet kernel size.
      postnet_n_convolution (int): Number of postnet convolutions.
class_docstr_tok: ["Postnet","Module",".","Args",":","n_mels","(","int",")",":","Number","of","mel","bins",".","postnet_embedding_dim","(","int",")",":","Postnet","embedding","dimension",".","postnet_kernel_size","(","int",")",":","Postnet","kernel","size",".","postnet_n_convolution","(","int",")",":","Number","of","postnet","convolutions","."]
code: def __init__(
      self,
      n_mels: int,
      postnet_embedding_dim: int,
      postnet_kernel_size: int,
      postnet_n_convolution: int,
  ):
      super().__init__()
      self.convolutions = nn.ModuleList()
  
      for i in range(postnet_n_convolution):
          in_channels = n_mels if i == 0 else postnet_embedding_dim
          out_channels = (
              n_mels
              if i == (postnet_n_convolution - 1)
              else postnet_embedding_dim
          )
          init_gain = (
              "linear" if i == (postnet_n_convolution - 1) else "tanh"
          )
          num_features = (
              n_mels
              if i == (postnet_n_convolution - 1)
              else postnet_embedding_dim
          )
          self.convolutions.append(
              nn.Sequential(
                  _get_conv1d_layer(
                      in_channels,
                      out_channels,
                      kernel_size=postnet_kernel_size,
                      stride=1,
                      padding=int((postnet_kernel_size - 1) / 2),
                      dilation=1,
                      w_init_gain=init_gain,
                  ),
                  nn.BatchNorm1d(num_features),
              )
          )
  
      self.n_convs = len(self.convolutions)
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new _Postnet object from inherited base classes: nn with example: obj = _Postnet(n_mels, postnet_embedding_dim, postnet_kernel_size, postnet_n_convolution)