code: def infer(self, spect, sigma=1.0):
      spect = self.upsample(spect)
      # trim conv artifacts. maybe pad spec to kernel multiple
      time_cutoff = (
          self.upsample.kernel_size[0] - self.upsample.stride[0]
      )
      spect = spect[:, :, :-time_cutoff]
  
      spect = spect.unfold(2, self.n_group, self.n_group).permute(
          0, 2, 1, 3
      )
      spect = spect.contiguous().view(spect.size(0), spect.size(1), -1)
      spect = spect.permute(0, 2, 1)
  
      audio = torch.randn(
          spect.size(0),
          self.n_remaining_channels,
          spect.size(2),
          device=spect.device,
      ).to(spect.dtype)
  
      audio = torch.autograd.Variable(sigma * audio)
  
      for k in reversed(range(self.n_flows)):
          n_half = int(audio.size(1) / 2)
          audio_0 = audio[:, :n_half, :]
          audio_1 = audio[:, n_half:, :]
  
          output = self.WN[k]((audio_0, spect))
          s = output[:, n_half:, :]
          b = output[:, :n_half, :]
          audio_1 = (audio_1 - b) / torch.exp(s)
          audio = torch.cat([audio_0, audio_1], 1)
  
          audio = self.convinv[k](audio, reverse=True)
  
          if k % self.n_early_every == 0 and k > 0:
              z = torch.randn(
                  spect.size(0),
                  self.n_early_size,
                  spect.size(2),
                  device=spect.device,
              ).to(spect.dtype)
              audio = torch.cat((sigma * z, audio), 1)
  
      audio = (
          audio.permute(0, 2, 1)
          .contiguous()
          .view(audio.size(0), -1)
          .data
      )
      return audio
  
file_path: serve/examples/text_to_speech_synthesizer/waveglow_model.py
imports: import torch
  from torch.autograd import Variable
  import torch.nn.functional
label_desc: Use image node_id 3 for calling the WaveGlow obj's underlying member method code with example usage: obj.infer(spect, sigma) and returns: audio