code: def get_diffusion_beta_schedule(
      schedule_type: Literal[
          "linear", "quadratic", "constant", "sigmoid"
      ],
      beta_start: float,
      beta_end: float,
      num_diffusion_timesteps: int,
      dtype: Optional[torch.dtype] = None,
      device: Optional[torch.device] = None,
  ) -> Tensor:
      r"""Generates a schedule of beta values according to the specified strategy
      for the diffusion process from the `"Denoising Diffusion Probabilistic
      Models" <https://arxiv.org/abs/2006.11239>`_ paper.
  
      Beta values are used to scale the noise added during the diffusion process
      in generative models. This function creates an array of beta values
      according to a pre-defined schedule, which can be either :obj:`"linear"`,
      :obj:`"quadratic"`, :obj:`"constant"`, or :obj:`"sigmoid"`.
  
      Args:
          schedule_type (str): The type of schedule to use for beta values.
          beta_start (float): The starting value of beta.
          beta_end (float): The ending value of beta.
          num_diffusion_timesteps (int): The number of timesteps for the
              diffusion process.
          dtype (torch.dtype, optional): The output data type.
              (default: :obj:`None`)
          device (torch.device, optional): The output device.
              (default: :obj:`None`)
      """
      if schedule_type == "linear":
          return torch.linspace(
              beta_start,
              beta_end,
              num_diffusion_timesteps,
              dtype=dtype,
              device=device,
          )
  
      if schedule_type == "quadratic":
          return (
              torch.linspace(
                  beta_start**0.5,
                  beta_end**0.5,
                  num_diffusion_timesteps,
                  dtype=dtype,
                  device=device,
              )
              ** 2
          )
  
      if schedule_type == "constant":
          return torch.full(
              (num_diffusion_timesteps,),
              fill_value=beta_end,
              dtype=dtype,
              device=device,
          )
  
      if schedule_type == "sigmoid":
          return (
              torch.linspace(
                  -6,
                  6,
                  num_diffusion_timesteps,
                  dtype=dtype,
                  device=device,
              ).sigmoid()
              * (beta_end - beta_start)
              + beta_start
          )
  
      raise ValueError(
          f"Found invalid 'schedule_type' (got '{schedule_type}')"
      )
  
imports: import math
  from typing import Literal, Optional
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: get_diffusion_beta_schedule(schedule_type, beta_start, beta_end, num_diffusion_timesteps, dtype, device) and returns: torch, unknown, torch, unknown