Spaces:
Running on Zero
Running on Zero
Download timm/utils/random.py from hugging-apps/progresvit-classify: direct link, hf CLI and curl.
- Browser
- Download file 178 Bytes
-
https://huggingface.co/spaces/hugging-apps/progresvit-classify/resolve/main/timm/utils/random.py
- Command line
-
hf download hf://spaces/hugging-apps/progresvit-classify/timm/utils/random.py
-
curl -L -o random.py https://huggingface.co/spaces/hugging-apps/progresvit-classify/resolve/main/timm/utils/random.py
178 Bytes
| import random | |
| import numpy as np | |
| import torch | |
| def random_seed(seed=42, rank=0): | |
| torch.manual_seed(seed + rank) | |
| np.random.seed(seed + rank) | |
| random.seed(seed + rank) | |