class_docstr: An implementation of a simple dense feedforward network, for use in, e.g., some conditional flows such as
  :class:`pyro.distributions.transforms.ConditionalPlanarFlow` and other unconditional flows such as
  :class:`pyro.distributions.transforms.AffineCoupling` that do not require an autoregressive network.
  
  Example usage:
  
  >>> input_dim = 10
  >>> context_dim = 5
  >>> z = torch.rand(100, context_dim)
  >>> nn = DenseNN(context_dim, [50], param_dims=[1, input_dim, input_dim])
  >>> a, b, c = nn(z)  # parameters of size (100, 1), (100, 10), (100, 10)
  
  :param input_dim: the dimensionality of the input
  :type input_dim: int
  :param hidden_dims: the dimensionality of the hidden units per layer
  :type hidden_dims: list[int]
  :param param_dims: shape the output into parameters of dimension (p_n,) for p_n in param_dims
      when p_n > 1 and dimension () when p_n == 1. The default is [1, 1], i.e. output two parameters of dimension ().
  :type param_dims: list[int]
  :param nonlinearity: The nonlinearity to use in the feedforward network such as torch.nn.ReLU(). Note that no
      nonlinearity is applied to the final network output, so the output is an unbounded real number.
  :type nonlinearity: torch.nn.module
code: def forward(self, x):
      return self._forward(x)
  
file_path: pyro/pyro/nn/dense_nn.py
imports: import torch
label_desc: Use image node_id 2 for calling the DenseNN obj's underlying member method code with example usage: obj.forward(x) and returns: self