code: def __init__(
      self,
      n_in_channels,
      n_context_dim,
      n_layers,
      affine_model="simple_conv",
      kernel_size=1,
      scaling_fn="exp",
      affine_activation="softplus",
      n_channels=1024,
      n_bins=8,
      left=-6,
      right=6,
      bottom=-6,
      top=6,
      use_quadratic=False,
  ):
      super(SplineTransformationLayerAR, self).__init__()
      self.n_in_channels = n_in_channels  # input dimensions
      self.left = left
      self.right = right
      self.bottom = bottom
      self.top = top
      self.n_bins = n_bins
      self.spline_fn = piecewise_linear_transform
      self.inv_spline_fn = piecewise_linear_inverse_transform
      self.use_quadratic = use_quadratic
  
      if self.use_quadratic:
          self.spline_fn = unbounded_piecewise_quadratic_transform
          self.inv_spline_fn = unbounded_piecewise_quadratic_transform
          self.n_bins = 2 * self.n_bins + 1
      final_out_channels = self.n_in_channels * self.n_bins
  
      # autoregressive flow, kernel size 1 and no dilation
      self.param_predictor = SimpleConvNet(
          n_context_dim,
          0,
          final_out_channels,
          n_layers,
          with_dilation=False,
          kernel_size=1,
          zero_init=True,
          use_partial_padding=False,
      )
  
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 1 to create a new SplineTransformationLayerAR object from inherited base classes: torch.nn with example: obj = SplineTransformationLayerAR(n_in_channels, n_context_dim, n_layers, affine_model, kernel_size, scaling_fn, affine_activation, n_channels, n_bins, left, right, bottom, top, use_quadratic)