code: def compute_mat(self, query_emb, ref_emb):
      dtype, device = query_emb.dtype, query_emb.device
      if ref_emb is None:
          ref_emb = query_emb
      if dtype == torch.float16:  # cdist doesn't work for float16
          rows, cols = lmu.meshgrid_from_sizes(
              query_emb, ref_emb, dim=0
          )
          output = torch.zeros(rows.size(), dtype=dtype, device=device)
          rows, cols = rows.flatten(), cols.flatten()
          distances = self.pairwise_distance(
              query_emb[rows], ref_emb[cols]
          )
          output[rows, cols] = distances
          return output
      else:
          return torch.cdist(query_emb, ref_emb, p=self.p)
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/distances/lp_distance.py
imports: import torch
  from ..utils import loss_and_miner_utils
  from .base_distance import BaseDistance
label_desc: Use image node_id 2 for calling the LpDistance obj's underlying member method code with example usage: obj.compute_mat(query_emb, ref_emb) and returns: output, torch