def bbox_area(bboxes):
    """
    Compute the area of a set of bounding boxes, which are specified by its
    (x1, y1, x2, y2) coordinates.

    Args:
        bboxes (Tensor[N, 4]): bboxes for which the area will be computed. They
            are expected to be in (x1, y1, x2, y2) format.

    Returns:
        areas (Tensor[N]): area for each box
    """
    return (bboxes[:, (2)] - bboxes[:, (0)]) * (bboxes[:, (3)] - bboxes[:, (1)]
        )
