code: def l2_distance_matrix(
      x: torch.Tensor, y: torch.Tensor
  ) -> torch.Tensor:
      """Get pair-wise l2 distances.
  
      Args:
          x: A torch feature tensor with shape (n, d).
          y: A torch feature tensor with shape (m, d).
  
      Returns: Distance tensor between features x and y with shape (n, m).
  
      """
      assert len(x.shape) == len(y.shape) == 2
      assert x.shape[1] == y.shape[1]
  
      return torch.cdist(x, y, p=2)
  
imports: import argparse
  import copy
  from typing import Dict, Tuple
  import numpy
  import torch
  from sklearn.metrics import average_precision_score
  from torch.nn import functional
  from metrics import METRICS_REGISTRY
  from metrics.metric_base import EpochMetric
  from utils import logger
  from utils.ddp_utils import is_master
  from utils.registry import Registry
label_desc: Use image node_id 2 for calling a global function with example usage: l2_distance_matrix(x, y) and returns: torch