default_collate

torchaug.data.dataloader.default_collate(batch)[source]

Take in a batch of data and put the elements within the batch into a tensor or ta_tensor with an additional outer dimension - batch size if relevant.

The exact output type can be a torch.Tensor, a Sequence of torch.Tensor, a Collection of torch.Tensor, TATensor, a Sequence of TATensor, a Collection of TATensor, or left unchanged, depending on the input type. This is used as the default function for collation when batch_size or batch_sampler is defined in DataLoader.

Here is the general input type (based on the type of the element within the batch) to output type mapping:

Parameters:

batch – a single batch to be collated