indices_by_split: List[List[int]] = []
for offset, length in zip(torch._utils._accumulate(lengths), lengths):
indices = []
for record_idx in record_indices[offset - length : offset]:
indices.extend(dataset.get_series_mol_idxs(record_idx))
indices_by_split.append(indices)
We are just using this to get the cumulative sum, so changing this to use np.cumsum(lengths) should work equivalently. I will make this change in PR #123
The random_record_split function relies on
_accumulate
fromtorch._utils
to get the offset indices. PyTorch 2.3 has removed this function.https://github.com/choderalab/modelforge/blob/90382d84cb0c8e813cb9e768d7a6326388d36bed/modelforge/dataset/utils.py#L465
We are just using this to get the cumulative sum, so changing this to use np.cumsum(lengths) should work equivalently. I will make this change in PR #123