cplx-torch 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cplx_torch/__init__.py +235 -0
- cplx_torch/_cpu_fallback.py +742 -0
- cplx_torch/_custom_ops.py +271 -0
- cplx_torch/_loader.py +68 -0
- cplx_torch/_native/__init__.py +1 -0
- cplx_torch/audio.py +112 -0
- cplx_torch/comms.py +111 -0
- cplx_torch/cupy_api.py +160 -0
- cplx_torch/device.py +95 -0
- cplx_torch/functional.py +1381 -0
- cplx_torch/geometry.py +162 -0
- cplx_torch/gnn.py +88 -0
- cplx_torch/init.py +94 -0
- cplx_torch/linalg.py +111 -0
- cplx_torch/losses.py +108 -0
- cplx_torch/mri.py +892 -0
- cplx_torch/nn.py +600 -0
- cplx_torch/optim.py +123 -0
- cplx_torch/quant.py +175 -0
- cplx_torch/quantum.py +232 -0
- cplx_torch/radar.py +102 -0
- cplx_torch/spectral.py +465 -0
- cplx_torch/vsa.py +117 -0
- cplx_torch/wave.py +207 -0
- cplx_torch-0.4.0.dist-info/METADATA +310 -0
- cplx_torch-0.4.0.dist-info/RECORD +29 -0
- cplx_torch-0.4.0.dist-info/WHEEL +5 -0
- cplx_torch-0.4.0.dist-info/licenses/LICENSE +200 -0
- cplx_torch-0.4.0.dist-info/top_level.txt +1 -0
cplx_torch/__init__.py
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"""cplx_torch: High-speed complex neural-network layers and GPU wave/VSA/geometry ops."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib.util
|
|
6
|
+
|
|
7
|
+
from . import cupy_api as cupy_api
|
|
8
|
+
from ._loader import is_native_available, load_native
|
|
9
|
+
|
|
10
|
+
__version__ = "0.4.0"
|
|
11
|
+
|
|
12
|
+
__all__ = ["__version__", "is_native_available", "load_native", "cupy_api"]
|
|
13
|
+
|
|
14
|
+
if importlib.util.find_spec("torch") is not None:
|
|
15
|
+
from . import audio as audio
|
|
16
|
+
from . import comms as comms
|
|
17
|
+
from . import device as device
|
|
18
|
+
from . import functional as functional
|
|
19
|
+
from . import geometry as geometry
|
|
20
|
+
from . import gnn as gnn
|
|
21
|
+
from . import init as init
|
|
22
|
+
from . import linalg as linalg
|
|
23
|
+
from . import losses as losses
|
|
24
|
+
from . import mri as mri
|
|
25
|
+
from . import nn as nn
|
|
26
|
+
from . import optim as optim
|
|
27
|
+
from . import quant as quant
|
|
28
|
+
from . import quantum as quantum
|
|
29
|
+
from . import radar as radar
|
|
30
|
+
from . import spectral as spectral
|
|
31
|
+
from . import vsa as vsa
|
|
32
|
+
from . import wave as wave
|
|
33
|
+
from ._custom_ops import register_custom_ops
|
|
34
|
+
from .device import gpu_info, supports_bf16_tensor_cores, supports_wmma_flash_attention
|
|
35
|
+
from .linalg import hermitian_eigh, unitary_polar_project
|
|
36
|
+
from .mri import (
|
|
37
|
+
EsNufft2d,
|
|
38
|
+
EsNufft2dAdjoint,
|
|
39
|
+
EsNufft3d,
|
|
40
|
+
EsNufft3dAdjoint,
|
|
41
|
+
KbNufft2d,
|
|
42
|
+
KbNufft2dAdjoint,
|
|
43
|
+
KbNufft3d,
|
|
44
|
+
KbNufft3dAdjoint,
|
|
45
|
+
NufftPlan2d,
|
|
46
|
+
NufftPlan3d,
|
|
47
|
+
)
|
|
48
|
+
from .quant import ComplexPolarQuantLinear, polar_dequantize, polar_quantize
|
|
49
|
+
from .functional import (
|
|
50
|
+
cardioid,
|
|
51
|
+
cayley_unitary,
|
|
52
|
+
combine_3m,
|
|
53
|
+
combine_4m,
|
|
54
|
+
complex_adaptive_avg_pool2d,
|
|
55
|
+
complex_avg_pool2d,
|
|
56
|
+
complex_batch_norm,
|
|
57
|
+
complex_conv1d,
|
|
58
|
+
complex_conv2d,
|
|
59
|
+
complex_conv_transpose2d,
|
|
60
|
+
complex_diag_scan,
|
|
61
|
+
complex_dropout,
|
|
62
|
+
complex_dropout2d,
|
|
63
|
+
complex_group_norm,
|
|
64
|
+
complex_instance_norm,
|
|
65
|
+
complex_layernorm,
|
|
66
|
+
complex_linear,
|
|
67
|
+
complex_rmsnorm,
|
|
68
|
+
complex_softmax,
|
|
69
|
+
crelu,
|
|
70
|
+
mod_max_pool2d,
|
|
71
|
+
mod_silu,
|
|
72
|
+
mod_swiglu,
|
|
73
|
+
mod_tanh,
|
|
74
|
+
modrelu,
|
|
75
|
+
ozaki_fp64_matmul,
|
|
76
|
+
rotary,
|
|
77
|
+
split_3m,
|
|
78
|
+
split_gelu,
|
|
79
|
+
split_to_planar,
|
|
80
|
+
zrelu,
|
|
81
|
+
)
|
|
82
|
+
from .nn import (
|
|
83
|
+
ComplexAdaptiveAvgPool2d,
|
|
84
|
+
ComplexAvgPool2d,
|
|
85
|
+
ComplexBatchNorm1d,
|
|
86
|
+
ComplexBatchNorm2d,
|
|
87
|
+
ComplexCReLU,
|
|
88
|
+
ComplexCardioid,
|
|
89
|
+
ComplexCayleyLinear,
|
|
90
|
+
ComplexConv1d,
|
|
91
|
+
ComplexConv2d,
|
|
92
|
+
ComplexConvTranspose2d,
|
|
93
|
+
ComplexDepthwiseConv2d,
|
|
94
|
+
ComplexDropout,
|
|
95
|
+
ComplexDropout2d,
|
|
96
|
+
ComplexGELU,
|
|
97
|
+
ComplexGroupNorm,
|
|
98
|
+
ComplexInstanceNorm2d,
|
|
99
|
+
ComplexLRUBlock,
|
|
100
|
+
ComplexLayerNorm,
|
|
101
|
+
ComplexLinear,
|
|
102
|
+
ComplexModMaxPool2d,
|
|
103
|
+
ComplexModReLU,
|
|
104
|
+
ComplexModTanh,
|
|
105
|
+
ComplexRMSNorm,
|
|
106
|
+
ComplexRotary,
|
|
107
|
+
ComplexSiLU,
|
|
108
|
+
ComplexSoftmax,
|
|
109
|
+
ComplexSwiGLU,
|
|
110
|
+
ComplexTransformerBlock,
|
|
111
|
+
ComplexZReLU,
|
|
112
|
+
)
|
|
113
|
+
from .optim import ComplexAdamW
|
|
114
|
+
from .spectral import (
|
|
115
|
+
ComplexAttention,
|
|
116
|
+
ComplexSpectralConv1d,
|
|
117
|
+
ComplexSpectralConv2d,
|
|
118
|
+
ComplexSpectralFilter1d,
|
|
119
|
+
complex_attention,
|
|
120
|
+
spectral_filter_1d,
|
|
121
|
+
)
|
|
122
|
+
from .wave import AngularSpectrumLayer, angular_spectrum_propagate, cis, helmholtz_greens_3d
|
|
123
|
+
|
|
124
|
+
register_custom_ops()
|
|
125
|
+
|
|
126
|
+
__all__ += [
|
|
127
|
+
"device",
|
|
128
|
+
"gpu_info",
|
|
129
|
+
"supports_bf16_tensor_cores",
|
|
130
|
+
"supports_wmma_flash_attention",
|
|
131
|
+
"register_custom_ops",
|
|
132
|
+
"linalg",
|
|
133
|
+
"quant",
|
|
134
|
+
"hermitian_eigh",
|
|
135
|
+
"unitary_polar_project",
|
|
136
|
+
"polar_quantize",
|
|
137
|
+
"polar_dequantize",
|
|
138
|
+
"ComplexPolarQuantLinear",
|
|
139
|
+
"KbNufft2d",
|
|
140
|
+
"KbNufft2dAdjoint",
|
|
141
|
+
"KbNufft3d",
|
|
142
|
+
"KbNufft3dAdjoint",
|
|
143
|
+
"EsNufft2d",
|
|
144
|
+
"EsNufft2dAdjoint",
|
|
145
|
+
"EsNufft3d",
|
|
146
|
+
"EsNufft3dAdjoint",
|
|
147
|
+
"NufftPlan2d",
|
|
148
|
+
"NufftPlan3d",
|
|
149
|
+
"ozaki_fp64_matmul",
|
|
150
|
+
"spectral_filter_1d",
|
|
151
|
+
"ComplexSpectralFilter1d",
|
|
152
|
+
"functional",
|
|
153
|
+
"nn",
|
|
154
|
+
"init",
|
|
155
|
+
"losses",
|
|
156
|
+
"optim",
|
|
157
|
+
"spectral",
|
|
158
|
+
"wave",
|
|
159
|
+
"vsa",
|
|
160
|
+
"geometry",
|
|
161
|
+
"gnn",
|
|
162
|
+
"mri",
|
|
163
|
+
"radar",
|
|
164
|
+
"comms",
|
|
165
|
+
"quantum",
|
|
166
|
+
"audio",
|
|
167
|
+
"modrelu",
|
|
168
|
+
"cardioid",
|
|
169
|
+
"zrelu",
|
|
170
|
+
"crelu",
|
|
171
|
+
"split_gelu",
|
|
172
|
+
"mod_silu",
|
|
173
|
+
"mod_tanh",
|
|
174
|
+
"mod_swiglu",
|
|
175
|
+
"complex_dropout",
|
|
176
|
+
"complex_dropout2d",
|
|
177
|
+
"complex_softmax",
|
|
178
|
+
"mod_max_pool2d",
|
|
179
|
+
"complex_avg_pool2d",
|
|
180
|
+
"complex_adaptive_avg_pool2d",
|
|
181
|
+
"complex_batch_norm",
|
|
182
|
+
"complex_group_norm",
|
|
183
|
+
"complex_instance_norm",
|
|
184
|
+
"complex_conv1d",
|
|
185
|
+
"complex_conv2d",
|
|
186
|
+
"complex_conv_transpose2d",
|
|
187
|
+
"cayley_unitary",
|
|
188
|
+
"rotary",
|
|
189
|
+
"complex_layernorm",
|
|
190
|
+
"complex_rmsnorm",
|
|
191
|
+
"complex_diag_scan",
|
|
192
|
+
"complex_linear",
|
|
193
|
+
"split_to_planar",
|
|
194
|
+
"combine_4m",
|
|
195
|
+
"split_3m",
|
|
196
|
+
"combine_3m",
|
|
197
|
+
"ComplexAdamW",
|
|
198
|
+
"ComplexModReLU",
|
|
199
|
+
"ComplexCardioid",
|
|
200
|
+
"ComplexZReLU",
|
|
201
|
+
"ComplexCReLU",
|
|
202
|
+
"ComplexGELU",
|
|
203
|
+
"ComplexSiLU",
|
|
204
|
+
"ComplexModTanh",
|
|
205
|
+
"ComplexDropout",
|
|
206
|
+
"ComplexDropout2d",
|
|
207
|
+
"ComplexSoftmax",
|
|
208
|
+
"ComplexModMaxPool2d",
|
|
209
|
+
"ComplexAvgPool2d",
|
|
210
|
+
"ComplexAdaptiveAvgPool2d",
|
|
211
|
+
"ComplexBatchNorm1d",
|
|
212
|
+
"ComplexBatchNorm2d",
|
|
213
|
+
"ComplexGroupNorm",
|
|
214
|
+
"ComplexInstanceNorm2d",
|
|
215
|
+
"ComplexConv1d",
|
|
216
|
+
"ComplexConv2d",
|
|
217
|
+
"ComplexConvTranspose2d",
|
|
218
|
+
"ComplexDepthwiseConv2d",
|
|
219
|
+
"ComplexCayleyLinear",
|
|
220
|
+
"ComplexSwiGLU",
|
|
221
|
+
"ComplexTransformerBlock",
|
|
222
|
+
"ComplexLRUBlock",
|
|
223
|
+
"ComplexRotary",
|
|
224
|
+
"ComplexLayerNorm",
|
|
225
|
+
"ComplexRMSNorm",
|
|
226
|
+
"ComplexLinear",
|
|
227
|
+
"ComplexAttention",
|
|
228
|
+
"ComplexSpectralConv1d",
|
|
229
|
+
"ComplexSpectralConv2d",
|
|
230
|
+
"complex_attention",
|
|
231
|
+
"AngularSpectrumLayer",
|
|
232
|
+
"angular_spectrum_propagate",
|
|
233
|
+
"cis",
|
|
234
|
+
"helmholtz_greens_3d",
|
|
235
|
+
]
|