code: def test_denoising_diffusion_sample():
      from speechbrain.nnet.diffusion import DenoisingDiffusion
  
      dummy_model = DummyModel()
      gen = torch.manual_seed(42)
  
      def noise(x):
          return torch.randn(*x.shape, generator=gen)
  
      diffusion = DenoisingDiffusion(
          model=dummy_model,
          timesteps=1000,
          noise=noise,
          beta_start=0.0001,
          beta_end=0.02,
      )
  
      sample = diffusion.sample((3, 2))
      sample_ref = torch.tensor(
          [[-0.4607, -0.3638], [0.4681, 0.3358], [-0.1250, -0.2619]]
      )
      assert sample.allclose(sample_ref, atol=0.0001)
  
imports: import torch
  from torch import nn
label_desc: Use image node_id 2 for calling a global function with example usage: test_denoising_diffusion_sample() and returns: torch