MCPcopy Create free account
hub / github.com/pytorch/executorch / _get_pytorch_cuda_url

Function _get_pytorch_cuda_url

install_utils.py:139–154  ·  view source on GitHub ↗

Get the appropriate PyTorch CUDA URL for the given CUDA version. Args: cuda_version: tuple of (major, minor) version numbers torch_nightly_url_base: Base URL for PyTorch nightly packages Returns: URL string for PyTorch CUDA packages

(cuda_version, torch_nightly_url_base)

Source from the content-addressed store, hash-verified

137
138
139def _get_pytorch_cuda_url(cuda_version, torch_nightly_url_base):
140 """
141 Get the appropriate PyTorch CUDA URL for the given CUDA version.
142
143 Args:
144 cuda_version: tuple of (major, minor) version numbers
145 torch_nightly_url_base: Base URL for PyTorch nightly packages
146
147 Returns:
148 URL string for PyTorch CUDA packages
149 """
150 major, minor = cuda_version
151 # Generate CUDA suffix (version validation is already done in _get_cuda_version)
152 cuda_suffix = _cuda_version_to_pytorch_suffix(major, minor)
153
154 return f"{torch_nightly_url_base}/{cuda_suffix}"
155
156
157@functools.lru_cache(maxsize=1)

Callers 1

determine_torch_urlFunction · 0.85

Calls 1

Tested by

no test coverage detected