code: def get_sigmas(self, n, device="cpu"):
      if n < self.num_timesteps:
          timesteps = generate_roughly_equally_spaced_steps(
              n, self.num_timesteps
          )
          alphas_cumprod = self.alphas_cumprod[timesteps]
      elif n == self.num_timesteps:
          alphas_cumprod = self.alphas_cumprod
      else:
          raise ValueError
  
      to_torch = partial(
          torch.tensor, dtype=torch.float32, device=device
      )
      sigmas = to_torch((1 - alphas_cumprod) / alphas_cumprod) ** 0.5
      return torch.flip(sigmas, (0,))
  
file_path: generative-models/sgm/modules/diffusionmodules/discretizer.py
imports: from abc import abstractmethod
  from functools import partial
  import numpy
  import torch
  from ...modules.diffusionmodules.util import make_beta_schedule
  from ...util import append_zero
label_desc: Use image node_id 2 for calling the LegacyDDPMDiscretization obj's underlying member method code with example usage: obj.get_sigmas(n, device) and returns: torch