code: def conditional_spline_autoregressive(
      input_dim,
      context_dim,
      hidden_dims=None,
      count_bins=8,
      bound=3.0,
      order="linear",
  ):
      r"""
      A helper function to create a
      :class:`~pyro.distributions.transforms.ConditionalSplineAutoregressive` object
      that takes care of constructing an autoregressive network with the correct
      input/output dimensions.
  
      :param input_dim: Dimension of input variable
      :type input_dim: int
      :param context_dim: Dimension of context variable
      :type context_dim: int
      :param hidden_dims: The desired hidden dimensions of the autoregressive network.
          Defaults to using [input_dim * 10, input_dim * 10]
      :type hidden_dims: list[int]
      :param count_bins: The number of segments comprising the spline.
      :type count_bins: int
      :param bound: The quantity :math:`K` determining the bounding box,
          :math:`[-K,K]\times[-K,K]`, of the spline.
      :type bound: float
      :param order: One of ['linear', 'quadratic'] specifying the order of the spline.
      :type order: string
  
      """
  
      if hidden_dims is None:
          hidden_dims = [input_dim * 10, input_dim * 10]
  
      param_dims = [count_bins, count_bins, count_bins - 1, count_bins]
      arn = ConditionalAutoRegressiveNN(
          input_dim, context_dim, hidden_dims, param_dims=param_dims
      )
      return ConditionalSplineAutoregressive(
          input_dim,
          arn,
          count_bins=count_bins,
          bound=bound,
          order=order,
      )
  
imports: from functools import partial
  import torch
  from pyro.nn import AutoRegressiveNN, ConditionalAutoRegressiveNN
  from ..None import constraints
  from ..conditional import ConditionalTransformModule
  from ..torch_transform import TransformModule
  from ..util import copy_docs_from
  from .spline import ConditionalSpline
label_desc: Use image node_id 2 for calling a global function with example usage: conditional_spline_autoregressive(input_dim, context_dim, hidden_dims, count_bins, bound, order) and returns: ConditionalSplineAutoregressive