code: def pairwaise_distance(output):
      """
      Function for calculating pairwise distance
  
      :param output (torch.FloatTensor): Input for calculating pairwise distance
      """
  
      output_squared = output.pow(2).sum(dim=1)
      product = torch.matmul(output, output.t())
      result = (
          output_squared.unsqueeze(0)
          + output_squared.unsqueeze(1)
          - 2 * product
      )
      result = result.clamp(min=1e-10)
      result = result.sqrt()
      result = result.clone()
      result[range(len(output)), range(len(output))] = 0
      return result
  
file_path: KD_Lib/KD_Lib/KD/vision/RKD/loss_metric.py
imports: import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: pairwaise_distance(output) and returns: result