pytorch/torch
Zeina Migeed ed6df0e324 correctly import torch.version (#157584)
The structure is

```
torch/
  __init__.py
  version.py
```

When we import torch, only `torch/__init__.py` is executed by default.

The submodules like `version.py` are not automatically imported or attached to the torch module.

So without anything in `__init__.py`, `torch.version` may not be found. So in this PR, we make the import explicit.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/157584
Approved by: https://github.com/ezyang
2025-07-07 21:43:35 +00:00
..
_awaits
_C Add device_id to XPU device properties (#156481) 2025-07-03 01:22:11 +00:00
_C_flatbuffer
_custom_op
_decomp Revert "Fix full_like decomposition to preserve strides (#144765)" 2025-07-02 13:56:03 +00:00
_dispatch Improve torch.ops typing (#154555) 2025-06-22 15:52:27 +00:00
_dynamo Fix typo: 'paramter' → 'parameter' in dynamo variable comment (#157651) 2025-07-07 19:42:44 +00:00
_export Remove is_jit_trace option (#157387) 2025-07-03 09:20:27 +00:00
_functorch Revert "[WIP] Automatically load and save dynamo entries via caching_precompile (#155913)" 2025-07-07 16:53:35 +00:00
_higher_order_ops [BE][12/16] fix typos in torch/ (#156602) 2025-07-02 22:55:29 +00:00
_inductor [logging] [redo] dynamo_timed for CachingAutotuner.coordinate_descent_tuning (#156840) 2025-07-07 19:09:48 +00:00
_lazy
_library [BE][PYFMT] migrate PYFMT for torch/_[a-h]*/ to ruff format (#144551) 2025-06-25 06:16:06 +00:00
_logging [BE][PYFMT] migrate PYFMT for torch/_[a-h]*/ to ruff format (#144551) 2025-06-25 06:16:06 +00:00
_numpy [BE][PYFMT] migrate PYFMT for torch/_[a-h]*/ to ruff format (#144551) 2025-06-25 06:16:06 +00:00
_prims [remove untyped defs] batch 1 (#157011) 2025-06-30 23:54:40 +00:00
_prims_common python definitely_contiguous-> is_contiguous_or_false (#156515) 2025-06-30 17:31:51 +00:00
_refs _broadcast_shapes gso generalizations (#157008) 2025-07-04 05:56:42 +00:00
_strobelight [BE][PYFMT] migrate PYFMT for torch/_[a-h]*/ to ruff format (#144551) 2025-06-25 06:16:06 +00:00
_subclasses [fake tensor] fix issue of no attribute tags (#156689) 2025-07-03 01:16:01 +00:00
_vendor
accelerator Revert "Add unified memory APIs for torch.accelerator (#152932)" 2025-06-25 00:11:35 +00:00
amp [BE][PYFMT] migrate PYFMT for torch/[a-c]*/ to ruff format (#144554) 2025-07-03 18:56:07 +00:00
ao [remove untyped defs] batch 1 (#157011) 2025-06-30 23:54:40 +00:00
autograd [BE][PYFMT] migrate PYFMT for torch/[a-c]*/ to ruff format (#144554) 2025-07-03 18:56:07 +00:00
backends [BE][PYFMT] migrate PYFMT for torch/[a-c]*/ to ruff format (#144554) 2025-07-03 18:56:07 +00:00
compiler Revert "[WIP] Automatically load and save dynamo entries via caching_precompile (#155913)" 2025-07-07 16:53:35 +00:00
contrib
cpu
csrc Add max_pool3d backward pass for MPS (#157498) 2025-07-07 19:46:44 +00:00
cuda [BE][PYFMT] migrate PYFMT for torch/[a-c]*/ to ruff format (#144554) 2025-07-03 18:56:07 +00:00
distributed [oss] Add version to metadata (#155343) 2025-07-07 20:57:30 +00:00
distributions Fix non-bitwise type annotations for Tensor operators (see #145838) (#146845) 2025-06-24 15:41:34 +00:00
export Remove is_jit_trace option (#157387) 2025-07-03 09:20:27 +00:00
fft [BE][PYFMT] migrate PYFMT for torch/[e-n]*/ to ruff format (#144553) 2025-06-17 08:18:47 +00:00
func
futures [BE][PYFMT] migrate PYFMT for torch/[e-n]*/ to ruff format (#144553) 2025-06-17 08:18:47 +00:00
fx [FP8] FP8 for SwishLayerNorm (#157574) 2025-07-04 01:06:21 +00:00
headeronly Reapply D77381084 / #156964: Rename torch::standalone to headeronly (#157251) 2025-06-30 23:25:30 +00:00
jit [BE][12/16] fix typos in torch/ (#156602) 2025-07-02 22:55:29 +00:00
legacy
lib [2/N] Fix cppcoreguidelines-init-variables suppression (#146237) 2025-06-19 23:26:42 +00:00
linalg
masked [BE][PYFMT] migrate PYFMT for torch/[e-n]*/ to ruff format (#144553) 2025-06-17 08:18:47 +00:00
monitor
mps [BE][12/16] fix typos in torch/ (#156602) 2025-07-02 22:55:29 +00:00
mtia [BE][PYFMT] migrate PYFMT for torch/[e-n]*/ to ruff format (#144553) 2025-06-17 08:18:47 +00:00
multiprocessing [BE][12/16] fix typos in torch/ (#156602) 2025-07-02 22:55:29 +00:00
nativert [nativert] Move Executor to PyTorch core (#157514) 2025-07-03 23:31:54 +00:00
nested [BE][12/16] fix typos in torch/ (#156602) 2025-07-02 22:55:29 +00:00
nn XCCL changes for DDP (#155497) 2025-07-03 05:18:08 +00:00
onnx [BE][12/16] fix typos in torch/ (#156602) 2025-07-02 22:55:29 +00:00
optim swa avoid stream sync (#157705) 2025-07-07 20:47:35 +00:00
package [BE][6/16] fix typos in torch/ (#156316) 2025-06-23 02:57:34 +00:00
profiler [profiler] add more CUDA API for kernel launcher (#156016) 2025-07-03 15:26:42 +00:00
quantization [BE][6/16] fix typos in torch/ (#156316) 2025-06-23 02:57:34 +00:00
signal [BE][6/16] fix typos in torch/ (#156316) 2025-06-23 02:57:34 +00:00
sparse [BE][6/16] fix typos in torch/ (#156316) 2025-06-23 02:57:34 +00:00
special [BE][6/16] fix typos in torch/ (#156316) 2025-06-23 02:57:34 +00:00
testing Add max_pool3d backward pass for MPS (#157498) 2025-07-07 19:46:44 +00:00
utils Fix torch.utils.cpp_extension parser for clang version 20.1.7+libcxx (#157666) 2025-07-06 01:35:00 +00:00
xpu [BE][6/16] fix typos in torch/ (#156316) 2025-06-23 02:57:34 +00:00
__config__.py
__future__.py
__init__.py correctly import torch.version (#157584) 2025-07-07 21:43:35 +00:00
_appdirs.py
_classes.py
_compile.py
_custom_ops.py
_deploy.py
_environment.py
_guards.py Revert "[dynamo][fsdp] Consistent behavior of int attributes (#157262)" 2025-07-02 08:30:39 +00:00
_jit_internal.py
_linalg_utils.py
_lobpcg.py Improve documentation for torch.lobpcg (#156139) 2025-06-25 00:39:34 +00:00
_lowrank.py
_meta_registrations.py python definitely_contiguous-> is_contiguous_or_false (#156515) 2025-06-30 17:31:51 +00:00
_namedtensor_internals.py
_ops.py Improve torch.ops typing (#154555) 2025-06-22 15:52:27 +00:00
_python_dispatcher.py
_size_docs.py
_sources.py
_storage_docs.py
_streambase.py
_tensor_docs.py
_tensor_str.py
_tensor.py Upgrade to DLPack 1.0. (#145000) 2025-06-30 16:58:06 +00:00
_thread_safe_fork.py
_torch_docs.py Documentation update torch.clone #156644 (#157007) 2025-06-27 21:10:09 +00:00
_utils_internal.py Revert "Inductor logging + analysis of torch.profile (#149697)" 2025-07-01 22:11:53 +00:00
_utils.py Disable pinning check when loading sparse tensors (#154638) 2025-06-18 14:33:36 +00:00
_VF.py
_vmap_internals.py
_weights_only_unpickler.py
CMakeLists.txt Revert "Simplify nvtx3 CMake handling, always use nvtx3 (#153784)" 2025-06-24 20:02:07 +00:00
custom_class_detail.h
custom_class.h
extension.h
functional.py
header_only_apis.txt Reapply D77381084 / #156964: Rename torch::standalone to headeronly (#157251) 2025-06-30 23:25:30 +00:00
hub.py
library.h
library.py
overrides.py Revert "Fused RMSNorm implementation (#153666)" 2025-07-01 18:46:45 +00:00
py.typed
quasirandom.py
random.py
return_types.py
script.h
serialization.py [BE] Add missing type for storage dict (#156831) 2025-06-26 02:48:55 +00:00
storage.py mypy 1.16.0 (#155821) 2025-06-14 18:18:43 +00:00
torch_version.py
types.py
version.py.tpl