data
collate_replace_corrupted(batch, dataset, default_collate_fn=None)
Collate function to handle corrupted examples in a batch by replacing them with valid ones.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
batch
|
Any
|
The batch of data from the DataLoader. |
required |
dataset
|
Dataset
|
The dataset being used, which should return |
required |
default_collate_fn
|
Callable | None
|
The default collate function to use once the batch is clean. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
A batch with corrupted examples replaced by valid ones. |