class_docstr: Conditional analogue of :class:`~pyro.distributions.torch_transform.ComposeTransformModule` .
  
  Useful as a base class for specifying complicated conditional distributions::
  
      >>> class ConditionalFlowStack(dist.conditional.ConditionalComposeTransformModule):
      ...     def __init__(self, input_dim, context_dim, hidden_dims, num_flows):
      ...         super().__init__([
      ...             dist.transforms.conditional_planar(input_dim, context_dim, hidden_dims)
      ...             for _ in range(num_flows)
      ...         ], cache_size=1)
  
      >>> cond_dist = dist.conditional.ConditionalTransformedDistribution(
      ...     dist.Normal(torch.zeros(3), torch.ones(3)).to_event(1),
      ...     [ConditionalFlowStack(3, 2, [8, 8], num_flows=4).inv]
      ... )
  
      >>> context = torch.rand(10, 2)
      >>> data = torch.rand(10, 3)
      >>> nll = -cond_dist.condition(context).log_prob(data)
code: def __init__(self, transforms, cache_size: int = 0):
      self.transforms = [
          ConstantConditionalTransform(t)
          if not isinstance(t, ConditionalTransform)
          else t
          for t in transforms
      ]
      super().__init__()
      if cache_size not in {0, 1}:
          raise ValueError("cache_size must be 0 or 1")
      self._cache_size = cache_size
      # for parameter storage
      for t in transforms:
          if isinstance(t, torch.nn.Module):
              self.append(t)
  
imports: from abc import ABC, abstractmethod
  import torch
  import torch.nn
  from .torch import TransformedDistribution
  from .torch_transform import ComposeTransformModule
label_desc: Use image node_id 1 to create a new ConditionalComposeTransformModule object from inherited base classes: ConditionalTransformModule, torch.nn with example: obj = ConditionalComposeTransformModule(transforms, cache_size)