code: def get_attention_map(g, src_nodes, dst_nodes, h):
      """
      To visualize the attention score between two set of nodes.
      """
      n, m = len(src_nodes), len(dst_nodes)
      weight = th.zeros(n, m, h).fill_(-1e8)
      for i, src in enumerate(src_nodes.tolist()):
          for j, dst in enumerate(dst_nodes.tolist()):
              if not g.has_edge_between(src, dst):
                  continue
              eid = g.edge_ids(src, dst)
              weight[i][j] = (
                  g.edata["score"][eid].squeeze(-1).cpu().detach()
              )
  
      weight = weight.transpose(0, 2)
      att = th.softmax(weight, -2)
      return att.numpy()
  
file_path: dgl/examples/pytorch/transformer/modules/viz.py
imports: import os
  import matplotlib
  import matplotlib.animation
  import matplotlib.pyplot
  import networkx
  import numpy
  import torch
  from networkx.algorithms import bipartite
  import networkx
  from matplotlib.patches import ConnectionStyle, FancyArrowPatch
  from networkx.utils import is_string_like
label_desc: Use image node_id 1 for calling a global function with example usage: get_attention_map(g, src_nodes, dst_nodes, h) and returns: att