torchcell.loader.dense_padding_data_loader.dense_padded_collate

dense_padded_collate(cls: type[BaseData], data_list: list[BaseData], follow_batch: list[str] | None = None, exclude_keys: list[str] | None = None) → tuple[BaseData, Mapping[Any, Any]][source]

Collate a list of data objects into a single dense object of type cls.

collate can handle both homogeneous and heterogeneous data objects by individually collating all their stores. In addition, collate can handle nested data structures such as dictionaries and lists.

Parameters:
  • cls (type) – The class into which to collate.

  • data_list (list) – A list of data objects.

  • follow_batch (list, optional) – Creates assignment batch vectors for each key in the list. (default: None)

  • exclude_keys (list, optional) – Will exclude each key in the list. (default: None)

Returns:

A tuple containing the collated data object and a dictionary holding optional batch feature masks.