class_docstr: Inverse Autoregressive Flow.
  
  Args:
      model_config (IAFConfig): The IAF model configuration setting the main parameters of the
          model.
code: def __init__(self, model_config: IAFConfig):
      BaseNF.__init__(self, model_config=model_config)
  
      self.net = []
      self.m = {}
      self.model_config = model_config
      self.input_dim = np.prod(model_config.input_dim)
      self.hidden_size = model_config.hidden_size
      self.model_name = "IAF"
  
      made_config = MADEConfig(
          input_dim=(self.input_dim,),
          output_dim=(self.input_dim,),
          hidden_sizes=[self.hidden_size]
          * self.model_config.n_hidden_in_made,
          degrees_ordering="sequential",
      )
  
      for i in range(model_config.n_made_blocks):
          self.net.extend([MADE(made_config)])
          if self.model_config.include_batch_norm:
              self.net.extend([BatchNorm(self.input_dim)])
  
      self.net = nn.ModuleList(self.net)
  
file_path: benchmark_VAE/src/pythae/models/normalizing_flows/iaf/iaf_model.py
imports: import os
  import numpy
  import torch
  import torch.nn
  from pythae.models.base.base_utils import ModelOutput
  from ..base import BaseNF
  from ..layers import BatchNorm
  from ..made import MADE, MADEConfig
  from .iaf_config import IAFConfig
label_desc: Use image node_id 1 to create a new IAF object from inherited base classes: BaseNF with example: obj = IAF(model_config)