dataeval.utils.data.collate.list_collate_fn

dataeval.utils.data.collate.list_collate_fn(batch_data_as_singles)

A collate function that takes a batch of individual data points in the format (input, target, metadata) and returns three lists: the input batch, the target batch, and the metadata batch. This is useful for loading data with torch.utils.data.DataLoader when the target and metadata are not tensors.

Parameters:
batch_data_as_singles : An iterable of (input, target, metadata) tuples.

Returns:

A tuple of three lists: the input batch, the target batch, and the metadata batch.

Return type:

tuple[Sequence[T_in], Sequence[T_tgt], Sequence[T_md]]