code: def get_distance_matrix(x):
      
      square = nd.sum(x ** 2.0, axis=1, keepdims=True)
      distance_square = square + square.transpose() - (2.0 * nd.dot(x, x.transpose()))
      return nd.sqrt(distance_square)
docs: Get distance matrix given a matrix. Used in testing.