class_docstr: Configuration class to store `Variable` sparsity configuration.
  This layout is an extension of FixedSparsityConfig in which:
    - user can set random layout; default value is zero means no random block
    - user can provide a list of local block sizes
    - user can provide a list of global block indices.
  
  For more details about `Fixed` sparsity config, please see `Generative Modeling with Sparse Transformers`: https://arxiv.org/abs/1904.10509; this has been customized.
  This class extends parent class of `SparsityConfig` and customizes it for `Fixed` sparsity.
class_docstr_tok: ["Configuration","class","to","store","`","Variable","`","sparsity","configuration",".","This","layout","is","an","extension","of","FixedSparsityConfig","in","which",":","-","user","can","set","random","layout",";","default","value","is","zero","means","no","random","block","-","user","can","provide","a","list","of","local","block","sizes","-","user","can","provide","a","list","of","global","block","indices",".","For","more","details","about","`","Fixed","`","sparsity","config",",","please","see","`","Generative","Modeling","with","Sparse","Transformers","`",":","https",":","\/\/arxiv.org\/abs\/1904.10509",";","this","has","been","customized",".","This","class","extends","parent","class","of","`","SparsityConfig","`","and","customizes","it","for","`","Fixed","`","sparsity","."]
docstr: Generates `Variable` sparsity layout used by each head in the sparse attention.
  
  Arguments:
       seq_len: required: an integer determining number of attention heads of the layer.
  
  Return:
       layout: a tensor of dimension (num_heads, num_blocks, num_blocks) containing `Variable` sparsity layout of all head
docstr_tok: ["Generates","`","Variable","`","sparsity","layout","used","by","each","head","in","the","sparse","attention",".","Arguments",":","seq_len",":","required",":","an","integer","determining","number","of","attention","heads","of","the","layer",".","Return",":","layout",":","a","tensor","of","dimension","(","num_heads",",","num_blocks",",","num_blocks",")","containing","`","Variable","`","sparsity","layout","of","all","head"]
code: def make_layout(self, seq_len):
      """Generates `Variable` sparsity layout used by each head in the sparse attention.
  
      Arguments:
           seq_len: required: an integer determining number of attention heads of the layer.
  
      Return:
           layout: a tensor of dimension (num_heads, num_blocks, num_blocks) containing `Variable` sparsity layout of all head
      """
  
      layout = self.setup_layout(seq_len)
      for h in range(0, self.num_layout_heads):
          layout = self.set_random_layout(h, layout)
          layout = self.set_local_layout(h, layout)
          layout = self.set_global_layout(h, layout)
  
      layout = self.check_and_propagate_first_head_layout(layout)
      return layout
  
imports: import torch
  import random
label_desc: Use image node_id 5 for calling the VariableSparsityConfig obj's underlying member method code with example usage: obj.make_layout(seq_len) and returns: layout