import torch


def ridgid_transform(points: torch.Tensor, transform: torch.Tensor) -> torch.Tensor:
    """
    Apply rigid transform (4,4) on points

    :param points: Points, shape (N,3).
    :param transform: Tranform matrix, shape (4,4).
    :return: Points after transform.
    """

    points_h = torch.cat([points, torch.ones((points.shape[0], 1), device=points.device)], 1) 
    points_h = (transform @ points_h.T).T
    
    return points_h[:, :3]