code: def pairwise_similarity(x, y=None):
      # x_norm = (x**2).sum(1).view(-1, 1)
  
      if y is not None:
          y_t = torch.transpose(y, 0, 1)
      else:
          y_t = torch.transpose(x, 0, 1)
  
      dist = torch.mm(x, y_t)
      return torch.clamp(dist, 0.0, np.inf)
  
file_path: pytorch-metric-learning/tests/losses/test_manifold_loss.py
imports: import unittest
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.module import Module
  from pytorch_metric_learning.losses import ManifoldLoss
  from ..None import TEST_DEVICE, TEST_DTYPES
label_desc: Use image node_id 1 for calling a global function with example usage: pairwise_similarity(x, y) and returns: torch