From ac086ca15b3605925847059ea7919c8ae50dfa31 Mon Sep 17 00:00:00 2001 From: mdmn07C5 Date: Mon, 12 Jul 2021 07:28:53 -0700 Subject: [PATCH] Update version.txt file path (#61177) Summary: The file version.txt is located one directory above generate_torch_version, some platforms are unable to find this file unless given an explicit path. Pull Request resolved: https://github.com/pytorch/pytorch/pull/61177 Reviewed By: pbelevich Differential Revision: D29660334 Pulled By: ezyang fbshipit-source-id: f66105f782aaff031e373f96a69baabb13c89337 --- tools/generate_torch_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_torch_version.py b/tools/generate_torch_version.py index 61682c9c89634..2ee17b76e52f4 100644 --- a/tools/generate_torch_version.py +++ b/tools/generate_torch_version.py @@ -13,7 +13,7 @@ def get_sha(pytorch_root: Union[str, Path]) -> str: def get_torch_version(sha: Optional[str] = None) -> str: pytorch_root = Path(__file__).parent.parent - version = open('version.txt', 'r').read().strip() + version = open(pytorch_root / 'version.txt', 'r').read().strip() if os.getenv('PYTORCH_BUILD_VERSION'): assert os.getenv('PYTORCH_BUILD_NUMBER') is not None