original_docstring: 
      Compute euclidean distance between two tensors
      
docstring: Compute euclidean distance between two tensors
docstring_tokens: Compute euclidean distance between two tensors
code: def euclidean_dist(x, y):
      '''
      Compute euclidean distance between two tensors
      '''
      # x: N x D
      # y: M x D
      n = x.size(0)
      m = y.size(0)
      d = x.size(1)
      if d != y.size(1):
          raise Exception
  
      x = x.unsqueeze(1).expand(n, m, d)
      y = y.unsqueeze(0).expand(n, m, d)
  
      return torch.pow(x - y, 2).sum(2)
code_tokens: def euclidean_dist ( x , y ) : n = x . size ( 0 ) m = y . size ( 0 ) d = x . size ( 1 ) if d != y . size ( 1 ) : raise Exception x = x . unsqueeze ( 1 ) . expand ( n , m , d ) y = y . unsqueeze ( 0 ) . expand ( n , m , d ) return torch . pow ( x - y , 2 ) . sum ( 2 )
short_docstring: Compute euclidean distance between two tensors
short_docstring_tokens: Compute euclidean distance between two tensors
comment: '''
      Compute euclidean distance between two tensors
      '''$SEP$# x: N x D$SEP$# y: M x D