code: def sample_mask_indices(input_dim, hidden_dim, simple=True):
      """
      Samples the indices assigned to hidden units during the construction of MADE masks
  
      :param input_dim: the dimensionality of the input variable
      :type input_dim: int
      :param hidden_dim: the dimensionality of the hidden layer
      :type hidden_dim: int
      :param simple: True to space fractional indices by rounding to nearest int, false round randomly
      :type simple: bool
      """
      indices = torch.linspace(
          1, input_dim, steps=hidden_dim, device="cpu"
      ).to(torch.Tensor().device)
      if simple:
          # Simple procedure tries to space fractional indices evenly by rounding to nearest int
          return torch.round(indices)
      else:
          # "Non-simple" procedure creates fractional indices evenly then rounds at random
          ints = indices.floor()
          ints += torch.bernoulli(indices - ints)
          return ints
  
imports: import warnings
  import torch
  import torch.nn
  from torch.nn import functional
label_desc: Use image node_id 1 for calling a global function with example usage: sample_mask_indices(input_dim, hidden_dim, simple) and returns: torch, ints