code: def test_layout_to_pattern():
      torch.allclose(
          AP.layout_to_pattern(
              layout=torch.Tensor([[[0, 1], [1, 0]], [[1, 0], [0, 1]]]),
              block_size=2,
          ),
          torch.Tensor(
              [
                  [
                      [0.0, 0.0, 1.0, 1.0],
                      [0.0, 0.0, 1.0, 1.0],
                      [1.0, 1.0, 0.0, 0.0],
                      [1.0, 1.0, 0.0, 0.0],
                  ],
                  [
                      [1.0, 1.0, 0.0, 0.0],
                      [1.0, 1.0, 0.0, 0.0],
                      [0.0, 0.0, 1.0, 1.0],
                      [0.0, 0.0, 1.0, 1.0],
                  ],
              ]
          ),
      )
  
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 17 for calling a global function with example usage: test_layout_to_pattern() without return types