Skip to content

Glossary: Computer Vision Beyond the Basics

Collate function

Also written: collate_fn, collate

A function a PyTorch `DataLoader` uses to combine individual samples into a batch. For detection, a custom collate function keeps images and targets as tuples, because photos have different numbers of boxes and can't be stacked into one tensor.

Where the book teaches it

Related terms

Target