code: def conditional_affine_autoregressive(
      input_dim, context_dim, hidden_dims=None, **kwargs
  ):
      """
      A helper function to create an
      :class:`~pyro.distributions.transforms.ConditionalAffineAutoregressive` object
      that takes care of constructing a dense 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 dense network. Defaults
          to using [10*input_dim]
      :type hidden_dims: list[int]
      :param log_scale_min_clip: The minimum value for clipping the log(scale) from
          the autoregressive NN
      :type log_scale_min_clip: float
      :param log_scale_max_clip: The maximum value for clipping the log(scale) from
          the autoregressive NN
      :type log_scale_max_clip: float
      :param sigmoid_bias: A term to add the logit of the input when using the stable
          tranform.
      :type sigmoid_bias: float
      :param stable: When true, uses the alternative "stable" version of the transform
          (see above).
      :type stable: bool
  
      """
      if hidden_dims is None:
          hidden_dims = [10 * input_dim]
      nn = ConditionalAutoRegressiveNN(
          input_dim, context_dim, hidden_dims
      )
      return ConditionalAffineAutoregressive(nn, **kwargs)
  
imports: from functools import partial
  import torch
  import torch.nn
  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 .utils import clamp_preserve_gradients
label_desc: Use image node_id 2 for calling a global function with example usage: conditional_affine_autoregressive(input_dim, context_dim, hidden_dims) and returns: ConditionalAffineAutoregressive