import torch


def box_se_to_cl(x: torch.Tensor) -> torch.Tensor:
    """
    Convert start-end coordinates to center-length coordinates
    """
    s, e = x.unbind(-1)
    b = [(s + e) / 2, (s - e)]
    return torch.stack(b, dim=-1)