class_docstr: Masked Autoencoder model
  
  Args:
      model_config (MADEConfig): The MADE model configuration setting the main parameters of the
          model
class_docstr_tok: ["Masked","Autoencoder","model","Args",":","model_config","(","MADEConfig",")",":","The","MADE","model","configuration","setting","the","main","parameters","of","the","model"]
code: def _make_mask(self, ordering="sequential"):
      # Get degrees for mask creation
  
      if ordering == "sequential":
          self.m[-1] = torch.arange(self.input_dim)
          for i in range(len(self.hidden_sizes)):
              self.m[i] = torch.arange(self.hidden_sizes[i]) % (
                  self.input_dim - 1
              )
  
      else:
          self.m[-1] = torch.randperm(self.input_dim)
          for i in range(len(self.hidden_sizes)):
              self.m[i] = torch.randint(
                  self.m[-1].min(),
                  self.input_dim - 1,
                  (self.hidden_sizes[i],),
              )
  
      masks = []
      for i in range(len(self.hidden_sizes)):
          masks += [
              (
                  self.m[i].unsqueeze(-1) >= self.m[i - 1].unsqueeze(0)
              ).float()
          ]
  
      masks.append(
          (
              self.m[len(self.hidden_sizes) - 1].unsqueeze(0)
              < self.m[-1].unsqueeze(-1)
          ).float()
      )
  
      return masks
  
file_path: benchmark_VAE/src/pythae/models/normalizing_flows/made/made_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 MaskedLinear
  from .made_config import MADEConfig
label_desc: Use image node_id 2 for calling the MADE obj's underlying member method code with example usage: obj._make_mask(ordering) and returns: masks