def collate(batch, *, collate_fn_map: Optional[Dict[Union[Type, Tuple[Type, ...]], Callable]] = None):
r"""
General collate function that handles collection type of element within each batch
and opens function registry to deal with specific element types. `default_collate_fn_map`
provides default collate functions for tensors, numpy arrays, numbers and strings.
the generic
collateAPI is implemented in pytorchpytorch/pytorch#85748
probably the monai helper functions could be simplified:
MONAI/monai/data/utils.py
Lines 448 to 451 in 50c3f32
MONAI/monai/data/utils.py
Lines 427 to 430 in 50c3f32