Instructions to use jonl521/modeling_simple with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonl521/modeling_simple with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jonl521/modeling_simple", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download .venv/lib/python3.14/site-packages/torch/_numpy/fft.py from jonl521/modeling_simple: direct link, hf CLI and curl.
- Browser
- Download file 2.81 kB
-
https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/_numpy/fft.py
- Command line
-
hf download hf://jonl521/modeling_simple/.venv/lib/python3.14/site-packages/torch/_numpy/fft.py
-
curl -L -o fft.py https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/_numpy/fft.py
2.81 kB
| # mypy: ignore-errors | |
| from __future__ import annotations | |
| import functools | |
| import torch | |
| from . import _dtypes_impl, _util | |
| from ._normalizations import ArrayLike, normalizer | |
| def upcast(func): | |
| """NumPy fft casts inputs to 64 bit and *returns 64-bit results*.""" | |
| def wrapped(tensor, *args, **kwds): | |
| target_dtype = ( | |
| _dtypes_impl.default_dtypes().complex_dtype | |
| if tensor.is_complex() | |
| else _dtypes_impl.default_dtypes().float_dtype | |
| ) | |
| tensor = _util.cast_if_needed(tensor, target_dtype) | |
| return func(tensor, *args, **kwds) | |
| return wrapped | |
| def fft(a: ArrayLike, n=None, axis=-1, norm=None): | |
| return torch.fft.fft(a, n, dim=axis, norm=norm) | |
| def ifft(a: ArrayLike, n=None, axis=-1, norm=None): | |
| return torch.fft.ifft(a, n, dim=axis, norm=norm) | |
| def rfft(a: ArrayLike, n=None, axis=-1, norm=None): | |
| return torch.fft.rfft(a, n, dim=axis, norm=norm) | |
| def irfft(a: ArrayLike, n=None, axis=-1, norm=None): | |
| return torch.fft.irfft(a, n, dim=axis, norm=norm) | |
| def fftn(a: ArrayLike, s=None, axes=None, norm=None): | |
| return torch.fft.fftn(a, s, dim=axes, norm=norm) | |
| def ifftn(a: ArrayLike, s=None, axes=None, norm=None): | |
| return torch.fft.ifftn(a, s, dim=axes, norm=norm) | |
| def rfftn(a: ArrayLike, s=None, axes=None, norm=None): | |
| return torch.fft.rfftn(a, s, dim=axes, norm=norm) | |
| def irfftn(a: ArrayLike, s=None, axes=None, norm=None): | |
| return torch.fft.irfftn(a, s, dim=axes, norm=norm) | |
| def fft2(a: ArrayLike, s=None, axes=(-2, -1), norm=None): | |
| return torch.fft.fft2(a, s, dim=axes, norm=norm) | |
| def ifft2(a: ArrayLike, s=None, axes=(-2, -1), norm=None): | |
| return torch.fft.ifft2(a, s, dim=axes, norm=norm) | |
| def rfft2(a: ArrayLike, s=None, axes=(-2, -1), norm=None): | |
| return torch.fft.rfft2(a, s, dim=axes, norm=norm) | |
| def irfft2(a: ArrayLike, s=None, axes=(-2, -1), norm=None): | |
| return torch.fft.irfft2(a, s, dim=axes, norm=norm) | |
| def hfft(a: ArrayLike, n=None, axis=-1, norm=None): | |
| return torch.fft.hfft(a, n, dim=axis, norm=norm) | |
| def ihfft(a: ArrayLike, n=None, axis=-1, norm=None): | |
| return torch.fft.ihfft(a, n, dim=axis, norm=norm) | |
| def fftfreq(n, d=1.0): | |
| return torch.fft.fftfreq(n, d) | |
| def rfftfreq(n, d=1.0): | |
| return torch.fft.rfftfreq(n, d) | |
| def fftshift(x: ArrayLike, axes=None): | |
| return torch.fft.fftshift(x, axes) | |
| def ifftshift(x: ArrayLike, axes=None): | |
| return torch.fft.ifftshift(x, axes) | |