def METHOD_NAME(self, pids):
    if isinstance(pids, list):
        pids = torch.tensor(pids)
    assert pids.dim() == 1
    if self.use_gpu:
        pids = pids.cuda()
    pids = pids.long()
    lengths = self.lengths[pids]
    if self.use_gpu:
        lengths = lengths.cuda()
    offsets = self.offsets[pids]
    return pids, lengths, offsets