code: def test_quick_layouts():
      seq_size = 128
      block_size = 16
      num_heads = 2
  
      # Fixed
      assert torch.allclose(
          AP.quick_fixed_layout(num_heads, block_size, seq_size),
          torch.Tensor(
              [
                  [
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                  ],
                  [
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 0, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1, 1],
                  ],
              ]
          ).long(),
      )
  
      # BSLongformer
      assert torch.allclose(
          AP.quick_bslongformer_layout(num_heads, block_size, seq_size),
          torch.Tensor(
              [
                  [
                      [1, 1, 1, 1, 1, 1, 1, 1],
                      [1, 1, 1, 0, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 0, 1, 1, 1, 0, 0, 0],
                      [1, 0, 0, 1, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 0],
                      [1, 0, 0, 0, 0, 1, 1, 1],
                      [1, 0, 0, 0, 0, 0, 1, 1],
                  ],
                  [
                      [1, 1, 1, 1, 1, 1, 1, 1],
                      [1, 1, 1, 0, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 0, 1, 1, 1, 0, 0, 0],
                      [1, 0, 0, 1, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 0],
                      [1, 0, 0, 0, 0, 1, 1, 1],
                      [1, 0, 0, 0, 0, 0, 1, 1],
                  ],
              ]
          ).long(),
      )
  
      # Variable
      assert torch.allclose(
          AP.quick_variable_layout(num_heads, block_size, seq_size),
          torch.Tensor(
              [
                  [
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                  ],
                  [
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 1, 1, 1, 0, 0, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                      [1, 0, 0, 0, 1, 1, 1, 1],
                  ],
              ]
          ).long(),
      )
  
      # BigBird (just the shape)
      assert AP.quick_bigbird_layout(
          num_heads, block_size, seq_size
      ).shape == torch.Size(
          [num_heads, seq_size // block_size, seq_size // block_size]
      )
  
imports: import itertools
  import pytest
  import torch
  import xformers.components.attention.attention_patterns
  from xformers.components.attention.sparsity_config import BigBirdSparsityConfig, BSLongformerSparsityConfig, DenseSparsityConfig, FixedSparsityConfig, VariableSparsityConfig
label_desc: Use image node_id 16 for calling a global function with example usage: test_quick_layouts() without return types