import torch


def get_cam_mat(width, height, focal_length):
    """
    Get intrinsic camera matrix (tensor)
    """
    cam_mat = torch.eye(3)
    cam_mat[0, 0] = focal_length
    cam_mat[1, 1] = focal_length
    cam_mat[0, 2] = width / 2
    cam_mat[1, 2] = height / 2
    cam_mat = cam_mat.cuda()
    return cam_mat