Is the collate function executed by every DataLoader worker?

Is the collate function executed by every DataLoader worker, or only by the main process?
So basically, does each worker only call __getitem__ and then put fetched samples into a queue for the main process to use the collate function and make a batch, or each worker process calls the collate function, creates batches and puts entire batches into a queue?

@vincentqb

cc @vincentqb for dataloader questions