Spaces:
Build error
Build error
Download tensor_typing.py from Lineage11/VoiceRestore2: direct link, hf CLI and curl.
- Browser
- Download file 447 Bytes
-
https://huggingface.co/spaces/Lineage11/VoiceRestore2/resolve/main/tensor_typing.py
- Command line
-
hf download hf://spaces/Lineage11/VoiceRestore2/tensor_typing.py
-
curl -L -o tensor_typing.py https://huggingface.co/spaces/Lineage11/VoiceRestore2/resolve/main/tensor_typing.py
447 Bytes
| from torch import Tensor | |
| from jaxtyping import ( | |
| Float, | |
| Int, | |
| Bool | |
| ) | |
| # jaxtyping is a misnomer, works for pytorch | |
| class TorchTyping: | |
| def __init__(self, abstract_dtype): | |
| self.abstract_dtype = abstract_dtype | |
| def __getitem__(self, shapes: str): | |
| return self.abstract_dtype[Tensor, shapes] | |
| Float = TorchTyping(Float) | |
| Int = TorchTyping(Int) | |
| Bool = TorchTyping(Bool) | |
| __all__ = [ | |
| Float, | |
| Int, | |
| Bool | |
| ] | |