original_docstring: 
      compute the eucilidean distance matrix between embeddings1 and embeddings2
      using gpu
      
docstring: compute the eucilidean distance matrix between embeddings1 and embeddings2
  using gpu
docstring_tokens: compute the eucilidean distance matrix between embeddings1 and embeddings2 using gpu
code: def pdist_torch(emb1, emb2):
      '''
      compute the eucilidean distance matrix between embeddings1 and embeddings2
      using gpu
      '''
      m, n = emb1.shape[0], emb2.shape[0]
      emb1_pow = torch.pow(emb1, 2).sum(dim = 1, keepdim = True).expand(m, n)
      emb2_pow = torch.pow(emb2, 2).sum(dim = 1, keepdim = True).expand(n, m).t()
      dist_mtx = emb1_pow + emb2_pow
      dist_mtx = dist_mtx.addmm_(1, -2, emb1, emb2.t())
      # dist_mtx = dist_mtx.clamp(min = 1e-12)
      dist_mtx = dist_mtx.clamp(min = 1e-12).sqrt()
      return dist_mtx
code_tokens: def pdist_torch ( emb1 , emb2 ) : m , n = emb1 . shape [ 0 ] , emb2 . shape [ 0 ] emb1_pow = torch . pow ( emb1 , 2 ) . sum ( dim = 1 , keepdim = True ) . expand ( m , n ) emb2_pow = torch . pow ( emb2 , 2 ) . sum ( dim = 1 , keepdim = True ) . expand ( n , m ) . t ( ) dist_mtx = emb1_pow + emb2_pow dist_mtx = dist_mtx . addmm_ ( 1 , - 2 , emb1 , emb2 . t ( ) ) dist_mtx = dist_mtx . clamp ( min = 1e-12 ) . sqrt ( ) return dist_mtx
short_docstring: compute the eucilidean distance matrix between embeddings1 and embeddings2
  using gpu
short_docstring_tokens: compute the eucilidean distance matrix between embeddings1 and embeddings2 using gpu
comment: '''
      compute the eucilidean distance matrix between embeddings1 and embeddings2
      using gpu
      '''$SEP$# dist_mtx = dist_mtx.clamp(min = 1e-12)