Download pllava/lib/python3.10/site-packages/torch/_VF.py from ZTWHHH/envs_2: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/datasets/ZTWHHH/envs_2/resolve/main/pllava/lib/python3.10/site-packages/torch/_VF.py
- Command line
-
hf download hf://datasets/ZTWHHH/envs_2/pllava/lib/python3.10/site-packages/torch/_VF.py
-
curl -L -o _VF.py https://huggingface.co/datasets/ZTWHHH/envs_2/resolve/main/pllava/lib/python3.10/site-packages/torch/_VF.py
664 Bytes
| """ | |
| This makes the functions in torch._C._VariableFunctions available as | |
| torch._VF.<funcname> | |
| without mypy being able to find them. | |
| A subset of those functions are mapped to ATen functions in | |
| torch/jit/_builtins.py | |
| See https://github.com/pytorch/pytorch/issues/21478 for the reason for | |
| introducing torch._VF | |
| """ | |
| import sys | |
| import types | |
| import torch | |
| class VFModule(types.ModuleType): | |
| vf: types.ModuleType | |
| def __init__(self, name: str): | |
| super().__init__(name) | |
| self.vf = torch._C._VariableFunctions | |
| def __getattr__(self, name: str) -> object: | |
| return getattr(self.vf, name) | |
| sys.modules[__name__] = VFModule(__name__) | |