class_docstr: An implementation of the deep Neural Autoregressive Flow (NAF) bijective
  transform of the "IAF flavour" conditioning on an additiona context variable
  that can be used for sampling and scoring samples drawn from it (but not
  arbitrary ones).
  
  Example usage:
  
  >>> from pyro.nn import ConditionalAutoRegressiveNN
  >>> input_dim = 10
  >>> context_dim = 5
  >>> batch_size = 3
  >>> base_dist = dist.Normal(torch.zeros(input_dim), torch.ones(input_dim))
  >>> arn = ConditionalAutoRegressiveNN(input_dim, context_dim, [40],
  ... param_dims=[16]*3)
  >>> transform = ConditionalNeuralAutoregressive(arn, hidden_units=16)
  >>> pyro.module("my_transform", transform)  # doctest: +SKIP
  >>> z = torch.rand(batch_size, context_dim)
  >>> flow_dist = dist.ConditionalTransformedDistribution(base_dist,
  ... [transform]).condition(z)
  >>> flow_dist.sample(sample_shape=torch.Size([batch_size]))  # doctest: +SKIP
  
  The inverse operation is not implemented. This would require numerical
  inversion, e.g., using a root finding method - a possibility for a future
  implementation.
  
  :param autoregressive_nn: an autoregressive neural network whose forward call
      returns a tuple of three real-valued tensors, whose last dimension is the
      input dimension, and whose penultimate dimension is equal to hidden_units.
  :type autoregressive_nn: nn.Module
  :param hidden_units: the number of hidden units to use in the NAF transformation
      (see Eq (8) in reference)
  :type hidden_units: int
  :param activation: Activation function to use. One of 'ELU', 'LeakyReLU',
      'sigmoid', or 'tanh'.
  :type activation: string
  
  Reference:
  
  [1] Chin-Wei Huang, David Krueger, Alexandre Lacoste, Aaron Courville. Neural
  Autoregressive Flows. [arXiv:1804.00779]
code: def __init__(self, autoregressive_nn, **kwargs):
      super().__init__()
      self.nn = autoregressive_nn
      self.kwargs = kwargs
  
imports: from functools import partial
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.distributions.transforms import SigmoidTransform, TanhTransform
  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 .basic import ELUTransform, LeakyReLUTransform
label_desc: Use image node_id 1 to create a new ConditionalNeuralAutoregressive object from inherited base classes: ConditionalTransformModule with example: obj = ConditionalNeuralAutoregressive(autoregressive_nn)