docstr: Compute noise schedule parameters
docstr_tok: ["Compute","noise","schedule","parameters"]
code: def compute_noise_level(self, beta):
      """Compute noise schedule parameters"""
      self.num_steps = len(beta)
      alpha = 1 - beta
      alpha_hat = np.cumprod(alpha)
      noise_level = np.concatenate([[1.0], alpha_hat**0.5], axis=0)
      noise_level = alpha_hat**0.5
  
      # pylint: disable=not-callable
      self.beta = torch.tensor(beta.astype(np.float32))
      self.alpha = torch.tensor(alpha.astype(np.float32))
      self.alpha_hat = torch.tensor(alpha_hat.astype(np.float32))
      self.noise_level = torch.tensor(noise_level.astype(np.float32))
  
      self.c1 = 1 / self.alpha**0.5
      self.c2 = (1 - self.alpha) / (1 - self.alpha_hat) ** 0.5
      self.sigma = (
          (1.0 - self.alpha_hat[:-1])
          / (1.0 - self.alpha_hat[1:])
          * self.beta[1:]
      ) ** 0.5
  
file_path: TTS/TTS/vocoder/models/wavegrad.py
imports: import numpy
  import torch
  from torch import nn
  from torch.nn.utils import weight_norm
  from ..layers.wavegrad import DBlock, FiLM, UBlock, Conv1d
label_desc: Use image node_id 6 for calling the Wavegrad obj's underlying member method code with example usage: obj.compute_noise_level(beta) without return types