Download torch-ext/first_kernel/__init__.py from drbh/first-kernel: direct link, hf CLI and curl.
- Browser
- Download file 252 Bytes
-
https://huggingface.co/kernels/drbh/first-kernel/resolve/main/torch-ext/first_kernel/__init__.py
- Command line
-
hf download hf://drbh/first-kernel/torch-ext/first_kernel/__init__.py
-
curl -L -o __init__.py https://huggingface.co/kernels/drbh/first-kernel/resolve/main/torch-ext/first_kernel/__init__.py
252 Bytes
| from typing import Optional | |
| import torch | |
| from ._ops import ops | |
| def first_kernel(x: torch.Tensor, out: Optional[torch.Tensor] = None) -> torch.Tensor: | |
| if out is None: | |
| out = torch.empty_like(x) | |
| ops.first_kernel(out, x) | |
| return out | |