import torch


def cthw2tlbr(boxes):
    """
    Convert center/size format `boxes` to top/left bottom/right corners.
    :param boxes: bounding boxes
    :return: bounding boxes
    """
    top_left = boxes[..., :2] - boxes[..., 2:]/2
    bot_right = boxes[..., :2] + boxes[..., 2:]/2
    return torch.cat([top_left, bot_right], dim=-1)