import torch


def simple_inter(box1, box2):
    """
    Simple intersection among bounding boxes.
    :param box1: bounding boxes coordinates.
    :param box2: bounding boxes coordinates.
    :return: intersection among pair of bounding boxes.
    """
    top_left_i = torch.max(box1[..., :2], box2[..., :2])
    bot_right_i = torch.min(box1[..., 2:], box2[..., 2:])
    sizes = torch.clamp(bot_right_i - top_left_i, min=0)
    return sizes[..., 0] * sizes[..., 1]