code: def polynomial(input_dim, hidden_dims=None):
      """
      A helper function to create a :class:`~pyro.distributions.transforms.Polynomial`
      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 hidden_dims: The desired hidden dimensions of of the autoregressive
          network. Defaults to using [input_dim * 10]
  
      """
  
      count_degree = 4
      count_sum = 3
      if hidden_dims is None:
          hidden_dims = [input_dim * 10]
      arn = AutoRegressiveNN(
          input_dim,
          hidden_dims,
          param_dims=[(count_degree + 1) * count_sum],
      )
      return Polynomial(
          arn,
          input_dim=input_dim,
          count_degree=count_degree,
          count_sum=count_sum,
      )
  
file_path: pyro/pyro/distributions/transforms/polynomial.py
imports: import math
  import torch
  import torch.nn
  from pyro.nn import AutoRegressiveNN
  from ..None import constraints
  from ..torch_transform import TransformModule
  from ..util import copy_docs_from
label_desc: Use image node_id 1 for calling a global function with example usage: polynomial(input_dim, hidden_dims) and returns: Polynomial