code: def to_attention_info(d: AttentionMask) -> AttentionInfo:
      return AttentionInfo(
          n_heads=d.n_head,
          ctx_blks_q=d.n_query_block,
          ctx_blks_k=d.n_key_block,
          block_size=d.block_size,
          pytorch_attn_bias=None,
      )
  
imports: import math
  from abc import ABC, abstractmethod
  from itertools import product
  from typing import Any, Optional
  import attr
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: to_attention_info(d) and returns: AttentionInfo