API symbolsutils
Copy
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 oftensorplay.Tensor, a Collection oftensorplay.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 inDataLoader.- Parameters:
batch – a single batch to be collated
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?
