Download models.py from davesalvi/ispl_safe: direct link, hf CLI and curl.
- Browser
- Download file 308 Bytes
-
https://huggingface.co/davesalvi/ispl_safe/resolve/main/models.py
- Command line
-
hf download hf://davesalvi/ispl_safe/models.py
-
curl -L -o models.py https://huggingface.co/davesalvi/ispl_safe/resolve/main/models.py
308 Bytes
| import torch | |
| class Model(torch.nn.Module): | |
| def __init__(self): | |
| super(Model, self).__init__() | |
| self.fc1 = torch.nn.Linear(10, 5) | |
| self.threshold = 0. | |
| def forward(self, x): | |
| ## generates a random float the same size as x | |
| return torch.randn(x.shape[0]).to(x.device) | |