in build_aarch64_wheel.py [0:0]
def build_torchvision(host: RemoteHost, *,
branch: str = "master",
use_conda: bool = True,
git_clone_flags: str) -> str:
print('Checking out TorchVision repo')
build_version = checkout_repo(host,
branch=branch,
url="https://github.com/pytorch/vision",
git_clone_flags=git_clone_flags,
mapping={
"v1.7.1": ("0.8.2", "rc2"),
"v1.8.0": ("0.9.0", "rc3"),
"v1.8.1": ("0.9.1", "rc1"),
"v1.9.0": ("0.10.0", "rc1"),
"v1.10.0": ("0.11.1", "rc1"),
"v1.10.1": ("0.11.2", "rc1"),
"v1.10.2": ("0.11.3", "rc1"),
"v1.11.0": ("0.12.0", "rc1"),
})
print('Building TorchVision wheel')
build_vars = ""
if branch == 'nightly':
version = host.check_output(["if [ -f vision/version.txt ]; then cat vision/version.txt; fi"]).strip()
if len(version) == 0:
# In older revisions, version was embedded in setup.py
version = host.check_output(["grep", "\"version = '\"", "vision/setup.py"]).strip().split("'")[1][:-2]
build_date = host.check_output("cd pytorch ; git log --pretty=format:%s -1").strip().split()[0].replace("-", "")
build_vars += f"BUILD_VERSION={version}.dev{build_date}"
elif build_version is not None:
build_vars += f"BUILD_VERSION={build_version}"
if host.using_docker():
build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
host.run_cmd(f"cd vision; {build_vars} python3 setup.py bdist_wheel")
vision_wheel_name = host.list_dir("vision/dist")[0]
embed_libgomp(host, use_conda, os.path.join('vision', 'dist', vision_wheel_name))
print('Copying TorchVision wheel')
host.download_wheel(os.path.join('vision', 'dist', vision_wheel_name))
print("Delete vision checkout")
host.run_cmd("rm -rf vision")
return vision_wheel_name