code: def test_audioldm_num_waveforms_per_prompt(self):
      device = "cpu"  # ensure determinism for the device-dependent torch.Generator
      components = self.get_dummy_components()
      components["scheduler"] = PNDMScheduler(skip_prk_steps=True)
      audioldm_pipe = AudioLDMPipeline(**components)
      audioldm_pipe = audioldm_pipe.to(device)
      audioldm_pipe.set_progress_bar_config(disable=None)
  
      prompt = "A hammer hitting a wooden surface"
  
      # test num_waveforms_per_prompt=1 (default)
      audios = audioldm_pipe(prompt, num_inference_steps=2).audios
  
      assert audios.shape == (1, 256)
  
      # test num_waveforms_per_prompt=1 (default) for batch of prompts
      batch_size = 2
      audios = audioldm_pipe(
          [prompt] * batch_size, num_inference_steps=2
      ).audios
  
      assert audios.shape == (batch_size, 256)
  
      # test num_waveforms_per_prompt for single prompt
      num_waveforms_per_prompt = 2
      audios = audioldm_pipe(
          prompt,
          num_inference_steps=2,
          num_waveforms_per_prompt=num_waveforms_per_prompt,
      ).audios
  
      assert audios.shape == (num_waveforms_per_prompt, 256)
  
      # test num_waveforms_per_prompt for batch of prompts
      batch_size = 2
      audios = audioldm_pipe(
          [prompt] * batch_size,
          num_inference_steps=2,
          num_waveforms_per_prompt=num_waveforms_per_prompt,
      ).audios
  
      assert audios.shape == (
          batch_size * num_waveforms_per_prompt,
          256,
      )
  
imports: import gc
  import unittest
  import numpy
  import torch
  import torch.nn.functional
  from transformers import ClapTextConfig, ClapTextModelWithProjection, RobertaTokenizer, SpeechT5HifiGan, SpeechT5HifiGanConfig
  from diffusers import AudioLDMPipeline, AutoencoderKL, DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler, UNet2DConditionModel
  from diffusers.utils import is_xformers_available
  from diffusers.utils.testing_utils import enable_full_determinism, nightly, torch_device
  from ..pipeline_params import TEXT_TO_AUDIO_BATCH_PARAMS, TEXT_TO_AUDIO_PARAMS
  from ..test_pipelines_common import PipelineTesterMixin
label_desc: Use image node_id 7 for calling the AudioLDMPipelineFastTests obj's underlying member method code with example usage: obj.test_audioldm_num_waveforms_per_prompt() without return types