How to specify PyTorch version with the cuda version when building from source?

When exporting PYTORCH_BUILD_VERSION=1.10.0 and PYTORCH_BUILD_NUMBER=1, I could build locally version 1.10.0 with PyTorch 1.10.0-rc3 from source. However, the cuda113 torchvision rc requests PyTorch version 1.10.0+cu113, and the PyTorch build fails if I export PYTORCH_BUILD_VERSION=1.10.0+cu113. I looked into the python script, and yet could only find this one method to specify the PyTorch version. I wondering how PyTorch team built the wheel with the cuda version tag. Similarly for CPU binaries, how did the public binary come with 1.10.0+cpu? Could someone help here? Thanks!

I guess the suffix might be added here. Also, you could check the builder repository for any usage of a suffix tag and would find e.g. this for torchvision.

Exporting PYTORCH_BUILD_VERSION=1.10.0+cpu and 1.10.0+cu113 works without issues in my current linux container now.
Regarding the scripts mentioned by @ptrblck , I think these scripts are run when promoting built binaries, not when building them. The vision script is under conda, and there isn’t one for torch. Thanks for the help though.