import torch


def removeind(ins, attr, indices):
    """Remove items at specified indices."""
    mask = torch.ones(len(ins), dtype=torch.bool)
    mask[indices] = False
    items = getattr(ins, attr)[mask]
    return items, mask