Add "xpu" to __all__ for torch/version.py (#149695)

As the title stated.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149695
Approved by: https://github.com/desertfire, https://github.com/guangyey
This commit is contained in:
FFFrog
2025-03-21 10:44:01 +08:00
committed by PyTorch MergeBot
parent 1700599266
commit 36f2d0aaba

View File

@ -97,7 +97,9 @@ if __name__ == "__main__":
with open(version_path, "w") as f:
f.write("from typing import Optional\n\n")
f.write("__all__ = ['__version__', 'debug', 'cuda', 'git_version', 'hip']\n")
f.write(
"__all__ = ['__version__', 'debug', 'cuda', 'git_version', 'hip', 'xpu']\n"
)
f.write(f"__version__ = '{version}'\n")
# NB: This is not 100% accurate, because you could have built the
# library code with DEBUG, but csrc without DEBUG (in which case