Download torch-rocm/__init__.py from Ashiedu/selective-update: direct link, hf CLI and curl.
- Browser
- Download file 397 Bytes
-
https://huggingface.co/Ashiedu/selective-update/resolve/main/torch-rocm/__init__.py
- Command line
-
hf download hf://Ashiedu/selective-update/torch-rocm/__init__.py
-
curl -L -o __init__.py https://huggingface.co/Ashiedu/selective-update/resolve/main/torch-rocm/__init__.py
397 Bytes
| from typing import Optional | |
| import torch | |
| from .functional import selective_state_update | |
| def selective_update(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: | |
| """Legacy scaffold kernel — adds 1.0 to each element.""" | |
| if out is None: | |
| out = torch.empty_like(x) | |
| out.copy_(x + 1.0) | |
| return out | |
| __all__ = ["selective_update", "selective_state_update"] | |