code: def test_fixed_sparsity_config():
      # chech that the case end < num_blocks is correct
      sc = FixedSparsityConfig(
          num_heads=1, horizontal_global_attention=True
      )
      assert torch.allclose(
          sc.make_layout(112),
          torch.Tensor(
              [
                  [
                      [1, 1, 1, 1, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 1],
                      [1, 1, 1, 1, 0, 0, 1],
                      [1, 1, 1, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1],
                      [0, 0, 0, 1, 1, 1, 1],
                      [1, 1, 1, 1, 1, 1, 1],
                  ]
              ]
          ).long(),
      )
      with pytest.raises(expected_exception=ValueError):
          FixedSparsityConfig(
              num_heads=1, num_local_blocks=3, num_global_blocks=2
          )
      with pytest.raises(expected_exception=NotImplementedError):
          FixedSparsityConfig(num_heads=1, attention="directional")
      with pytest.raises(expected_exception=ValueError):
          FixedSparsityConfig(
              num_heads=1,
              attention="unidirectional",
              horizontal_global_attention=True,
          )
      with pytest.raises(expected_exception=ValueError):
          FixedSparsityConfig(
              num_heads=1,
              num_different_global_patterns=2,
              different_layout_per_head=False,
          )
      with pytest.raises(expected_exception=ValueError):
          FixedSparsityConfig(
              num_heads=1,
              num_different_global_patterns=10,
              num_local_blocks=4,
              num_global_blocks=1,
          )
  
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 21 for calling a global function with example usage: test_fixed_sparsity_config() without return types