code: def sim_matrix(a, b, eps=1e-8):
      """
      added eps for numerical stability
      """
      a_n, b_n = a.norm(dim=1)[:, None], b.norm(dim=1)[:, None]
      a_norm = a / torch.max(a_n, eps * torch.ones_like(a_n))
      b_norm = b / torch.max(b_n, eps * torch.ones_like(b_n))
      sim_mt = torch.mm(a_norm, b_norm.transpose(0, 1))
      return sim_mt
  
imports: from collections import OrderedDict
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: sim_matrix(a, b, eps) and returns: sim_mt