code: def triton_attention(
      layout,
      block: int,
      query: torch.Tensor,
      key: torch.Tensor,
      value: torch.Tensor,
      scale: float,
  ):
      sparse_dot_sdd_nt = triton.ops.blocksparse.matmul(
          layout,
          block,
          "sdd",
          trans_a=False,
          trans_b=True,
          device=value.device,
      )
      sparse_dot_dsd_nn = triton.ops.blocksparse.matmul(
          layout,
          block,
          "dsd",
          trans_a=False,
          trans_b=False,
          device=value.device,
      )
      sparse_softmax = triton.ops.blocksparse.softmax(
          layout, block, device=value.device
      )
  
      w = sparse_dot_sdd_nt(query, key)
      w = sparse_softmax(w, scale=scale, is_causal=True)
      a = sparse_dot_dsd_nn(w, value)
      return a
  
file_path: triton/python/test/unit/operators/test_blocksparse.py
imports: import pytest
  import torch
  import triton
  import triton.ops
label_desc: Use image node_id 7 for calling a global function with example usage: triton_attention(layout, block, query, key, value, scale) and returns: a