Spaces:
Running on Zero
Running on Zero
Download spac/sparse/__init__.py from Jack04810/SPAC-4B-ZeroGPU: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/Jack04810/SPAC-4B-ZeroGPU/resolve/main/spac/sparse/__init__.py
- Command line
-
hf download hf://spaces/Jack04810/SPAC-4B-ZeroGPU/spac/sparse/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/Jack04810/SPAC-4B-ZeroGPU/resolve/main/spac/sparse/__init__.py
786 Bytes
| """TorchSparse primitives used by the released SPAC VQ-VAE.""" | |
| import importlib | |
| BACKEND = "torchsparse" | |
| ATTN = "sdpa" | |
| DEBUG = False | |
| _MODULES = { | |
| "SparseTensor": "basic", | |
| "sparse_batch_broadcast": "basic", | |
| "sparse_batch_op": "basic", | |
| "sparse_unbind": "basic", | |
| "SparseGroupNorm32": "norm", | |
| "SparseSiLU": "nonlinearity", | |
| "SparseGELU": "nonlinearity", | |
| "SparseTanh": "nonlinearity", | |
| "SparseLinear": "linear", | |
| "SparseConv3d": "conv", | |
| "SparseDownsample": "spatial", | |
| "SparseSubdivide": "spatial", | |
| } | |
| def __getattr__(name): | |
| if name not in _MODULES: | |
| raise AttributeError(name) | |
| value = getattr(importlib.import_module(f".{_MODULES[name]}", __name__), name) | |
| globals()[name] = value | |
| return value | |
| __all__ = list(_MODULES) | |