class_docstr: Compute RKD Distance Loss.
  Paper Refer to: Relational Knowledge Disitllation, CVPR2019. https://arxiv.org/abs/1904.05068
  Code Refer to: https://github.com/HobbitLong/RepDistiller/blob/master/distiller_zoo/RKD.py
  and https://github.com/lenscloth/RKD/blob/master/metric/loss.py
docstr: Compute pairwise Euclidean distances between embeddings in n-dimensional space.
  
  Parameters
  ----------
  embeddings
      The embeddings to compute pairwise distance between. Shape: (N,D)
  squared
      If the result is square of Euclidean distance.
  eps
      Min value of each entry.
  
  Returns
  -------
  Pairwise Euclidean distances. Shape: (N,N)
docstr_tok: ["Compute","pairwise","Euclidean","distances","between","embeddings","in","n-dimensional","space",".","Parameters","--","--","--","--","--","embeddings","The","embeddings","to","compute","pairwise","distance","between",".","Shape",":","(","N",",","D",")","squared","If","the","result","is","square","of","Euclidean","distance",".","eps","Min","value","of","each","entry",".","Returns","--","--","--","-","Pairwise","Euclidean","distances",".","Shape",":","(","N",",","N",")"]
code: def pdist(
      embeddings: Optional[torch.Tensor],
      squared: Optional[bool] = False,
      eps: Optional[float] = 1e-12,
  ):
      """
      Compute pairwise Euclidean distances between embeddings in n-dimensional space.
  
      Parameters
      ----------
      embeddings
          The embeddings to compute pairwise distance between. Shape: (N,D)
      squared
          If the result is square of Euclidean distance.
      eps
          Min value of each entry.
  
      Returns
      -------
      Pairwise Euclidean distances. Shape: (N,N)
      """
      e_square = embeddings.pow(2).sum(dim=1)
      prod = embeddings @ embeddings.t()
      res = (
          e_square.unsqueeze(1) + e_square.unsqueeze(0) - 2 * prod
      ).clamp(min=eps)
  
      if not squared:
          res = res.sqrt()
  
      res = res.clone()
      res[range(len(embeddings)), range(len(embeddings))] = 0
  
      return res
  
imports: import logging
  from typing import Optional
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 3 for calling the RKDLoss obj's underlying member method code with example usage: obj.pdist(embeddings, squared, eps) and returns: res