(batch)
| 9 | |
| 10 | |
| 11 | def numpy_collate(batch): |
| 12 | if isinstance(batch[0], np.ndarray): |
| 13 | return np.stack(batch) |
| 14 | elif isinstance(batch[0], (tuple,list)): |
| 15 | transposed = zip(*batch) |
| 16 | return [numpy_collate(samples) for samples in transposed] |
| 17 | else: |
| 18 | return np.array(batch) |
| 19 | |
| 20 | |
| 21 | class NumpyLoader(data.DataLoader): |
nothing calls this directly
no outgoing calls
no test coverage detected