code: def test_resample_size(self):
      input_path = common_utils.get_asset_path("sinewave.wav")
      waveform, sample_rate = common_utils.load_wav(input_path)
  
      upsample_rate = sample_rate * 2
      downsample_rate = sample_rate // 2
      invalid_resampling_method = "foo"
  
      with self.assertRaises(ValueError):
          torchaudio.transforms.Resample(
              sample_rate,
              upsample_rate,
              resampling_method=invalid_resampling_method,
          )
  
      upsample_resample = torchaudio.transforms.Resample(
          sample_rate,
          upsample_rate,
          resampling_method="sinc_interp_hann",
      )
      up_sampled = upsample_resample(waveform)
  
      # we expect the upsampled signal to have twice as many samples
      self.assertTrue(up_sampled.size(-1) == waveform.size(-1) * 2)
  
      downsample_resample = torchaudio.transforms.Resample(
          sample_rate,
          downsample_rate,
          resampling_method="sinc_interp_hann",
      )
      down_sampled = downsample_resample(waveform)
  
      # we expect the downsampled signal to have half as many samples
      self.assertTrue(down_sampled.size(-1) == waveform.size(-1) // 2)
  
imports: import math
  import torch
  import torchaudio
  import torchaudio.functional
  import torchaudio.transforms
  from torchaudio_unittest import common_utils
label_desc: Use image node_id 13 for calling the Tester obj's underlying member method code with example usage: obj.test_resample_size() without return types