code: def _horizontal_axial_2d_distance(H, W, p=2.0):
      i, _ = _generate_2d_grid(H, W)
      ij = i.reshape(-1, 1).float()
      d = torch.cdist(ij, ij, p=p)
      return d
  
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 3 for calling a global function with example usage: _horizontal_axial_2d_distance(H, W, p) and returns: d