def convert_points_from_homogeneous(points: torch.Tensor, eps: float=1e-08) -> torch.Tensor:
    'Function that converts points from homogeneous to Euclidean space.\n\n    Examples::\n\n        >>> input = torch.rand(2, 4, 3)  # BxNx3\n        >>> output = convert_points_from_homogeneous(input)  # BxNx2\n    '
    if (not isinstance(points, torch.Tensor)):
        raise TypeError('Input type is not a torch.Tensor. Got {}'.format(type(points)))
    if (len(points.shape) < 2):
        raise ValueError('Input must be at least a 2D tensor. Got {}'.format(points.shape))
    z_vec: torch.Tensor = points[..., (- 1):]
    mask: torch.Tensor = (torch.abs(z_vec) > eps)
    scale: torch.Tensor = torch.ones_like(z_vec).masked_scatter_(mask, (torch.tensor(1.0).to(points.device) / z_vec[mask]))
    return (scale * points[..., :(- 1)])
Function that converts points from homogeneous to Euclidean space.

Examples::

    >>> input = torch.rand(2, 4, 3)  # BxNx3
    >>> output = convert_points_from_homogeneous(input)  # BxNx2
def convert_points_from_homogeneous(points: torch.Tensor, eps: float=1e-08) -> torch.Tensor:
    'Function that converts points from homogeneous to Euclidean space.\n\n    Examples::\n\n        >>> input = torch.rand(2, 4, 3)  # BxNx3\n        >>> output = convert_points_from_homogeneous(input)  # BxNx2\n    '
    if (not isinstance(points, torch.Tensor)):
        raise TypeError('Input type is not a torch.Tensor. Got {}'.format(type(points)))
    if (len(points.shape) < 2):
        raise ValueError('Input must be at least a 2D tensor. Got {}'.format(points.shape))
    z_vec: torch.Tensor = points[..., (- 1):]
    mask: torch.Tensor = (torch.abs(z_vec) > eps)
    scale: torch.Tensor = torch.ones_like(z_vec).masked_scatter_(mask, (torch.tensor(1.0).to(points.device) / z_vec[mask]))
    return (scale * points[..., :(- 1)])