TensorPlay
API symbolsutils
Copy
View MarkdownDownload .md

tensorplay.utils.data.default_collate

tensorplay.utils.data.default_collate(batch)[source]

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

The exact output type can be a tensorplay.Tensor, a Sequence of tensorplay.Tensor, a Collection of tensorplay.Tensor, 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.

Parameters:

batch – a single batch to be collated

Ask DeepWiki