Spaces:
Configuration error
Configuration error
Download lib/datasets/collate_batch.py from pengsida/NeuralBody: direct link, hf CLI and curl.
- Browser
- Download file 320 Bytes
-
https://huggingface.co/spaces/pengsida/NeuralBody/resolve/refs%2Fpr%2F2/lib/datasets/collate_batch.py
- Command line
-
hf download hf://spaces/pengsida/NeuralBody@refs/pr/2/lib/datasets/collate_batch.py
-
curl -L -o collate_batch.py https://huggingface.co/spaces/pengsida/NeuralBody/resolve/refs%2Fpr%2F2/lib/datasets/collate_batch.py
320 Bytes
| from torch.utils.data.dataloader import default_collate | |
| import torch | |
| import numpy as np | |
| _collators = { | |
| } | |
| def make_collator(cfg, is_train): | |
| collator = cfg.train.collator if is_train else cfg.test.collator | |
| if collator in _collators: | |
| return _collators[collator] | |
| else: | |
| return default_collate | |