class_docstr: Upscale the dimensions of a spectrogram.
  
  Args:
      upsample_scales: the list of upsample scales.
      n_res_block: the number of ResBlock in stack. (Default: ``10``)
      n_freq: the number of bins in a spectrogram. (Default: ``128``)
      n_hidden: the number of hidden dimensions of resblock. (Default: ``128``)
      n_output: the number of output dimensions of melresnet. (Default: ``128``)
      kernel_size: the number of kernel size in the first Conv1d layer. (Default: ``5``)
  
  Examples
      >>> upsamplenetwork = UpsampleNetwork(upsample_scales=[4, 4, 16])
      >>> input = torch.rand(10, 128, 10)  # a random spectrogram
      >>> output = upsamplenetwork(input)  # shape: (10, 128, 1536), (10, 128, 1536)
class_docstr_tok: ["Upscale","the","dimensions","of","a","spectrogram",".","Args",":","upsample_scales",":","the","list","of","upsample","scales",".","n_res_block",":","the","number","of","ResBlock","in","stack",".","(","Default",":","``","10","``",")","n_freq",":","the","number","of","bins","in","a","spectrogram",".","(","Default",":","``","128","``",")","n_hidden",":","the","number","of","hidden","dimensions","of","resblock",".","(","Default",":","``","128","``",")","n_output",":","the","number","of","output","dimensions","of","melresnet",".","(","Default",":","``","128","``",")","kernel_size",":","the","number","of","kernel","size","in","the","first","Conv1d","layer",".","(","Default",":","``","5","``",")","Examples",">",">",">","upsamplenetwork","=","UpsampleNetwork","(","upsample_scales=","[","4",",","4",",","16","]",")",">",">",">","input","=","torch.rand","(","10",",","128",",","10",")","#","a","random","spectrogram",">",">",">","output","=","upsamplenetwork","(","input",")","#","shape",":","(","10",",","128",",","1536",")",",","(","10",",","128",",","1536",")"]
docstr: Pass the input through the UpsampleNetwork layer.
  
  Args:
      specgram (Tensor): the input sequence to the UpsampleNetwork layer (n_batch, n_freq, n_time)
  
  Return:
      Tensor shape: (n_batch, n_freq, (n_time - kernel_size + 1) * total_scale),
                    (n_batch, n_output, (n_time - kernel_size + 1) * total_scale)
  where total_scale is the product of all elements in upsample_scales.
docstr_tok: ["Pass","the","input","through","the","UpsampleNetwork","layer",".","Args",":","specgram","(","Tensor",")",":","the","input","sequence","to","the","UpsampleNetwork","layer","(","n_batch",",","n_freq",",","n_time",")","Return",":","Tensor","shape",":","(","n_batch",",","n_freq",",","(","n_time","-","kernel_size","+","1",")","*","total_scale",")",",","(","n_batch",",","n_output",",","(","n_time","-","kernel_size","+","1",")","*","total_scale",")","where","total_scale","is","the","product","of","all","elements","in","upsample_scales","."]
code: def forward(self, specgram: Tensor) -> Tuple[Tensor, Tensor]:
      r"""Pass the input through the UpsampleNetwork layer.
  
      Args:
          specgram (Tensor): the input sequence to the UpsampleNetwork layer (n_batch, n_freq, n_time)
  
      Return:
          Tensor shape: (n_batch, n_freq, (n_time - kernel_size + 1) * total_scale),
                        (n_batch, n_output, (n_time - kernel_size + 1) * total_scale)
      where total_scale is the product of all elements in upsample_scales.
      """
  
      resnet_output = self.resnet(specgram).unsqueeze(1)
      resnet_output = self.resnet_stretch(resnet_output)
      resnet_output = resnet_output.squeeze(1)
  
      specgram = specgram.unsqueeze(1)
      upsampling_output = self.upsample_layers(specgram)
      upsampling_output = upsampling_output.squeeze(1)[
          :, :, self.indent : -self.indent
      ]
  
      return upsampling_output, resnet_output
  
imports: import math
  from typing import List, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch import nn, Tensor
label_desc: Use image node_id 2 for calling the UpsampleNetwork obj's underlying member method code with example usage: obj.forward(specgram) and returns: upsampling_output,  resnet_output