default_collate_fn

paddle.fluid.dataloader.dataloader_iter. default_collate_fn ( batch ) [source]

Default batch collating function for fluid.io.DataLoader, batch should be a list of samples, and each sample should be a list of fields as follows:

[[filed1, filed2, …], [filed1, filed2, …], …]

This default collate function zipped each filed together and stack each filed as the batch field as follows:

[batch_filed1, batch_filed2, …]

Parameters

batch (list of list of numpy array) – the batch data, each fields should be a numpy array, each sample should be a list of fileds, and batch should be a list of sample.

Returns

collated batch

Return type

a list of numpy array