docstr: Validate the output dimensions of a UpsampleNetwork block.
docstr_tok: ["Validate","the","output","dimensions","of","a","UpsampleNetwork","block","."]
code: def test_waveform(self):
      """Validate the output dimensions of a UpsampleNetwork block."""
  
      upsample_scales = [5, 5, 8]
      n_batch = 2
      n_time = 200
      n_freq = 100
      n_output = 256
      n_res_block = 10
      n_hidden = 128
      kernel_size = 5
  
      total_scale = 1
      for upsample_scale in upsample_scales:
          total_scale *= upsample_scale
  
      model = UpsampleNetwork(
          upsample_scales,
          n_res_block,
          n_freq,
          n_hidden,
          n_output,
          kernel_size,
      )
  
      x = torch.rand(n_batch, n_freq, n_time)
      out1, out2 = model(x)
  
      assert out1.size() == (
          n_batch,
          n_freq,
          total_scale * (n_time - kernel_size + 1),
      )
      assert out2.size() == (
          n_batch,
          n_output,
          total_scale * (n_time - kernel_size + 1),
      )
  
imports: import itertools
  from collections import namedtuple
  import torch
  from parameterized import parameterized
  from torchaudio.models import ConvTasNet, DeepSpeech, Wav2Letter, WaveRNN
  from torchaudio.models.wavernn import MelResNet, UpsampleNetwork
  from torchaudio_unittest import common_utils
  from torchaudio_unittest.common_utils import torch_script
label_desc: Use image node_id 1 for calling the TestUpsampleNetwork obj's underlying member method code with example usage: obj.test_waveform() without return types