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","."]
docstr: Pass the input through Postnet.
  
  Args:
      x (Tensor): The input sequence with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``).
  
  Return:
      x (Tensor): Tensor with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``).
docstr_tok: ["Pass","the","input","through","Postnet",".","Args",":","x","(","Tensor",")",":","The","input","sequence","with","shape","(","n_batch",",","``","n_mels","``",",","max","of","``","mel_specgram_lengths","``",")",".","Return",":","x","(","Tensor",")",":","Tensor","with","shape","(","n_batch",",","``","n_mels","``",",","max","of","``","mel_specgram_lengths","``",")","."]
code: def forward(self, x: Tensor) -> Tensor:
      r"""Pass the input through Postnet.
  
      Args:
          x (Tensor): The input sequence with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``).
  
      Return:
          x (Tensor): Tensor with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``).
      """
  
      for i, conv in enumerate(self.convolutions):
          if i < self.n_convs - 1:
              x = F.dropout(
                  torch.tanh(conv(x)), 0.5, training=self.training
              )
          else:
              x = F.dropout(conv(x), 0.5, training=self.training)
  
      return x
  
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 2 for calling the _Postnet obj's underlying member method code with example usage: obj.forward(x) and returns: x