def homogeneous_to_euclidean(points):
    """Converts torch homogeneous points to euclidean
    Args:
        points torch tensor of shape (N, M + 1): N homogeneous points of dimension M
    Returns:
        torch tensor of shape (N, M): euclidean points
    """
    return (points.transpose(1, 0)[:-1] / points.transpose(1, 0)[-1]).transpose(1, 0)