def METHOD_NAME(self, encoder_out, indices):
    enc, mask, ckattn = encoder_out
    if not th.is_tensor(indices):
        indices = th.LongTensor(indices).to(enc.device)
    enc = th.index_select(enc, 0, indices)
    mask = th.index_select(mask, 0, indices)
    ckattn = th.index_select(ckattn, 0, indices)
    return enc, mask, ckattn