class_docstr: Glow Affine Coupling block as in GlowTTS paper.
  https://arxiv.org/pdf/1811.00002.pdf
  
   x --> x0 -> conv1d -> wavenet -> conv1d --> t, s -> concat(s*x1 + t, x0) -> o
     '-> x1 - - - - - - - - - - - - - - - - - - - - - - - - - ^
  
   Args:
       in_channels (int): number of input tensor channels.
       hidden_channels (int): number of hidden channels.
       kernel_size (int): WaveNet filter kernel size.
       dilation_rate (int): rate to increase dilation by each layer in a decoder block.
       num_layers (int): number of WaveNet layers.
       c_in_channels (int): number of conditioning input channels.
       dropout_p (int): wavenet dropout rate.
       sigmoid_scale (bool): enable/disable sigmoid scaling for output scale.
  
   Note:
       It does not use conditional inputs differently from WaveGlow.
   
class_docstr_tok: ["Glow","Affine","Coupling","block","as","in","GlowTTS","paper",".","https",":","\/\/arxiv.org\/pdf\/1811.00002.pdf","x","--",">","x0","-",">","conv1d","-",">","wavenet","-",">","conv1d","--",">","t",",","s","-",">","concat","(","s","*","x1","+","t",",","x0",")","-",">","o","'-",">","x1","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","^","Args",":","in_channels","(","int",")",":","number","of","input","tensor","channels",".","hidden_channels","(","int",")",":","number","of","hidden","channels",".","kernel_size","(","int",")",":","WaveNet","filter","kernel","size",".","dilation_rate","(","int",")",":","rate","to","increase","dilation","by","each","layer","in","a","decoder","block",".","num_layers","(","int",")",":","number","of","WaveNet","layers",".","c_in_channels","(","int",")",":","number","of","conditioning","input","channels",".","dropout_p","(","int",")",":","wavenet","dropout","rate",".","sigmoid_scale","(","bool",")",":","enable\/disable","sigmoid","scaling","for","output","scale",".","Note",":","It","does","not","use","conditional","inputs","differently","from","WaveGlow","."]
docstr: Shapes:
      x: B x C x T
      x_mask: B x 1 x T
      g: B x C x 1
docstr_tok: ["Shapes",":","x",":","B","x","C","x","T","x_mask",":","B","x","1","x","T","g",":","B","x","C","x","1"]
code: def forward(
      self, x, x_mask=None, reverse=False, g=None, **kwargs
  ):  # pylint: disable=unused-argument
      """
      Shapes:
          x: B x C x T
          x_mask: B x 1 x T
          g: B x C x 1
      """
      if x_mask is None:
          x_mask = 1
      x_0, x_1 = (
          x[:, : self.in_channels // 2],
          x[:, self.in_channels // 2 :],
      )
  
      x = self.start(x_0) * x_mask
      x = self.wn(x, x_mask, g)
      out = self.end(x)
  
      z_0 = x_0
      t = out[:, : self.in_channels // 2, :]
      s = out[:, self.in_channels // 2 :, :]
      if self.sigmoid_scale:
          s = torch.log(1e-6 + torch.sigmoid(s + 2))
  
      if reverse:
          z_1 = (x_1 - t) * torch.exp(-s) * x_mask
          logdet = None
      else:
          z_1 = (t + torch.exp(s) * x_1) * x_mask
          logdet = torch.sum(s * x_mask, [1, 2])
  
      z = torch.cat([z_0, z_1], 1)
      return z, logdet
  
file_path: TTS/TTS/tts/layers/glow_tts/glow.py
imports: import torch
  from torch import nn
  from torch.nn import functional
  from TTS.tts.layers.generic.wavenet import WN
  from ..generic.normalization import LayerNorm
label_desc: Use image node_id 2 for calling the CouplingBlock obj's underlying member method code with example usage: obj.forward(x, x_mask, reverse, g) and returns: z,  logdet