class_docstr: The layer outputs both the convolution, and the log determinant
  of its weight matrix.  If inverse=True it does convolution with
  inverse
class_docstr_tok: ["The","layer","outputs","both","the","convolution",",","and","the","log","determinant","of","its","weight","matrix",".","If","inverse=True","it","does","convolution","with","inverse"]
code: def forward(self, z, inverse=False):
      # DO NOT apply n_of_groups, as it doesn't account for padded sequences
      W = self.conv.weight.squeeze()
  
      if inverse:
          if not hasattr(self, "W_inverse"):
              # Inverse computation
              W_inverse = W.float().inverse().to(dtype=z.dtype)
              self.W_inverse = W_inverse[..., None]
          z = F.conv1d(
              z, self.W_inverse, bias=None, stride=1, padding=0
          )
          return z
      else:
          # Forward computation
          log_det_W = torch.logdet(W).clone()
          z = self.conv(z)
          return z, log_det_W
  
imports: from typing import Optional, Tuple
  import numpy
  import torch
  from torch import Tensor, nn
  from torch.cuda import amp
  from torch.cuda.amp import autocast
  from torch.nn import functional
  from nemo.collections.tts.modules.submodules import ConvNorm, LinearNorm, MaskedInstanceNorm1d
  from nemo.collections.tts.parts.utils.helpers import get_mask_from_lengths, sort_tensor, unsort_tensor
  from nemo.collections.tts.parts.utils.splines import piecewise_linear_inverse_transform, piecewise_linear_transform, unbounded_piecewise_quadratic_transform
label_desc: Use image node_id 2 for calling the Invertible1x1Conv obj's underlying member method code with example usage: obj.forward(z, inverse) and returns: z, z,  log_det_W