code: def rescale_adj(adj, dim="all"):
      if dim == "view":
          out_degree = adj.sum(dim=-1)
          out_degree_sqrt_inv = out_degree.pow(-1)
          out_degree_sqrt_inv[out_degree_sqrt_inv == float("inf")] = 0
          adj_prime = out_degree_sqrt_inv.unsqueeze(-1) * adj
  
      elif dim == "all":
          num_neighbors = adj.sum(dim=(1, 2)).float()
          num_neighbors_inv = num_neighbors.pow(-1)
          num_neighbors_inv[num_neighbors_inv == float("inf")] = 0
          adj_prime = num_neighbors_inv.unsqueeze(1).unsqueeze(2) * adj
      return adj_prime
  
label_desc: Use image node_id 1 for calling a global function with example usage: rescale_adj(adj, dim) and returns: adj_prime