Automatically install the latest PyTorch version?

Hi all,

I noticed that the pip installation of PyTorch depends on the supported CUDA version, e.g. for 11.7 or 11.8, respectively.
I am looking for a give me the most recent CUDA version supported version that in particular updates the used CUDA version by automatically resolving to the latest version available. Is there such an option or, alternatively, how can this latest supported CUDA version be determined by curl or something similar?
I would like to use this as part of an installation / update script to not only update the pip packages but also PyTorch’s CUDA version to the latest supported one.

Thanks in advance!