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

Function install_optional_example_requirements

install_requirements.py:110–149  ·  view source on GitHub ↗
(use_pytorch_nightly)

Source from the content-addressed store, hash-verified

108
109
110def install_optional_example_requirements(use_pytorch_nightly):
111 # Determine the appropriate PyTorch URL based on CUDA delegate status
112 torch_url = determine_torch_url(TORCH_URL_BASE)
113
114 print("Installing torch domain libraries")
115 DOMAIN_LIBRARIES = [
116 ("torchvision==0.27.0" if use_pytorch_nightly else "torchvision"),
117 ("torchaudio==2.11.0" if use_pytorch_nightly else "torchaudio"),
118 ]
119 # Then install domain libraries
120 subprocess.run(
121 [
122 sys.executable,
123 "-m",
124 "pip",
125 "install",
126 "--no-cache-dir",
127 *DOMAIN_LIBRARIES,
128 "--extra-index-url",
129 torch_url,
130 ],
131 check=True,
132 )
133
134 print("Installing packages in requirements-examples.txt")
135 subprocess.run(
136 [
137 sys.executable,
138 "-m",
139 "pip",
140 "install",
141 "-r",
142 "requirements-examples.txt",
143 "--extra-index-url",
144 torch_url,
145 "--upgrade-strategy",
146 "only-if-needed",
147 ],
148 check=True,
149 )
150
151
152def main(args):

Callers 2

mainFunction · 0.90
mainFunction · 0.85

Calls 2

determine_torch_urlFunction · 0.90
runMethod · 0.45

Tested by

no test coverage detected