mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
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
This commit is contained in:
committed by
PyTorch MergeBot
parent
5c79a55e7e
commit
ed6df0e324
@ -34,6 +34,8 @@ from typing import (
|
||||
)
|
||||
from typing_extensions import ParamSpec as _ParamSpec, TypeIs as _TypeIs
|
||||
|
||||
from . import version
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .types import Device, IntLikeType
|
||||
|
Reference in New Issue
Block a user