(batch: dotdict)
| 28 | |
| 29 | |
| 30 | def print_shape(batch: dotdict): |
| 31 | if isinstance(batch, dict): |
| 32 | for k, v in batch.items(): |
| 33 | print(k) |
| 34 | print_shape(v) |
| 35 | elif isinstance(batch, list): |
| 36 | for v in batch: |
| 37 | print_shape(v) |
| 38 | elif isinstance(batch, torch.Tensor): |
| 39 | print(f'{batch.shape}') |
| 40 | else: |
| 41 | print(batch) |
| 42 | |
| 43 | |
| 44 | type_mapping = { |