docstr: x: B x D X T 
docstr_tok: ["x",":","B","x","D","X","T"]
code: def inference(self, x, y_n=None):
      """x: B x D X T"""
      if y_n is None:
          y_n = torch.randn(
              x.shape[0],
              1,
              self.hop_len * x.shape[-1],
              dtype=torch.float32,
          ).to(x)
      else:
          y_n = torch.FloatTensor(y_n).unsqueeze(0).unsqueeze(0).to(x)
      sqrt_alpha_hat = self.noise_level.to(x)
      for n in range(len(self.alpha) - 1, -1, -1):
          y_n = self.c1[n] * (
              y_n
              - self.c2[n]
              * self.forward(
                  y_n, x, sqrt_alpha_hat[n].repeat(x.shape[0])
              )
          )
          if n > 0:
              z = torch.randn_like(y_n)
              y_n += self.sigma[n - 1] * z
          y_n.clamp_(-1.0, 1.0)
      return y_n
  
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 4 for calling the Wavegrad obj's underlying member method code with example usage: obj.inference(x, y_n) and returns: y_n