Download softmax.py from Code2aum/HRM_sudoku: direct link, hf CLI and curl.
- Browser
- Download file 194 Bytes
-
https://huggingface.co/Code2aum/HRM_sudoku/resolve/main/softmax.py
- Command line
-
hf download hf://Code2aum/HRM_sudoku/softmax.py
-
curl -L -o softmax.py https://huggingface.co/Code2aum/HRM_sudoku/resolve/main/softmax.py
194 Bytes
| import torch | |
| import torch.nn.functional as F | |
| sample = torch.tensor([[1,2,3,4,5], [5,4,3,2,1]], dtype=torch.float32, device='cuda') | |
| ref = F.softmax(sample, dim=1) | |
| print(f"Softmax result: {ref=}") |