def remove_small_bboxes(bboxes, min_size):
    """
    Remove bounding boxes which contains at least one side smaller than
    the minimum size.

    Args:
        bboxes (:obj:`nn.Tensor[N, 4]`): Bounding boxes to be computed. They
            are expected to be in ``(x1, y1, x2, y2)`` format.
        min_size (float): The minimum size of bounding boxes.

    Returns:
        :obj:`nn.Tensor[K]`: Indices of the bounding boxes that have both \
            sides larger than ``min_size``.
    """
    ws, hs = bboxes[:, 2] - bboxes[:, 0], bboxes[:, 3] - bboxes[:, 1]

    keep = (ws >= min_size) & (hs >= min_size)
    keep = keep.nonzero(as_tuple=False).squeeze(1)

    return keep