code: def make_lut(layout, block, device):
      _empty = torch.tensor([], dtype=torch.int64, device=layout.device)
      sizes = _empty.clone()
      # sizes along rows
      for h in range(layout.shape[0]):
          sizes = torch.cat((sizes, layout[h, :, :].sum(-1)))
      # offsets in block format
      offsets = torch.zeros_like(sizes)
      offsets[1:] = torch.cumsum(sizes[:-1], dim=0)
      # block indices
      idx = torch.arange(layout.sum())
      head = layout.nonzero()[:, 0]
      rows = layout.nonzero()[:, 1]
      columns = layout.nonzero()[:, 2]
      core = torch.stack((idx, columns, rows, head), dim=1).view(-1)
      # construct look-up table
      offsets = offsets * 4 + 2 * sizes.numel()
      header = torch.stack((sizes, offsets), dim=1).view(-1)
      lut = torch.cat((header, core)).type(torch.int32).to(device)
      return lut, int(sizes.max())
  
file_path: DeepSpeed/deepspeed/ops/sparse_attention/softmax.py
imports: import torch
  import triton
  import triton.language
label_desc: Use image node_id 1 for calling the _sparse_softmax obj's underlying member method code with example usage: obj.make_lut(layout, block, device) and returns: lut,  int