class_docstr: The layer outputs both the convolution, and the log determinant
  of its weight matrix.  If reverse=True it does convolution with
  inverse
class_docstr_tok: ["The","layer","outputs","both","the","convolution",",","and","the","log","determinant","of","its","weight","matrix",".","If","reverse=True","it","does","convolution","with","inverse"]
code: def __init__(self, c):
      super(Invertible1x1Conv, self).__init__()
      self.conv = torch.nn.Conv1d(
          c, c, kernel_size=1, stride=1, padding=0, bias=False
      )
  
      # Sample a random orthonormal matrix to initialize weights
      W = torch.linalg.qr(torch.FloatTensor(c, c).normal_())[0]
  
      # Ensure determinant is 1.0 not -1.0
      if torch.det(W) < 0:
          W[:, 0] = -1 * W[:, 0]
      W = W.view(c, c, 1)
      self.conv.weight.data = W
  
imports: import copy
  import torch
  from torch.autograd import Variable
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new Invertible1x1Conv object from inherited base classes: torch.nn with example: obj = Invertible1x1Conv(c)