def METHOD_NAME(
    cls,
    batches: t.Sequence[torch.Tensor],
    batch_dim: int = 0,
) -> t.Tuple[torch.Tensor, list[int]]:
    batch = torch.cat(tuple(batches), dim=batch_dim)
    indices = list(
        itertools.accumulate(subbatch.shape[batch_dim] for subbatch in batches)
    )
    indices = [0] + indices
    return batch, indices