Returns the full pip install command string for torch based on GPU choice. Returns the command string, or the default NVIDIA CUDA command if no GPU choice is set.
()
| 69 | |
| 70 | |
| 71 | def get_torch_command(): |
| 72 | """ |
| 73 | Returns the full pip install command string for torch based on GPU choice. |
| 74 | Returns the command string, or the default NVIDIA CUDA command if no GPU choice is set. |
| 75 | """ |
| 76 | sources = _get_torch_sources() |
| 77 | |
| 78 | package = sources["package"] |
| 79 | index_url = sources["index_url"] |
| 80 | |
| 81 | if index_url: |
| 82 | return f"{package} --index-url {index_url}" |
| 83 | return package |
| 84 | |
| 85 | |
| 86 | TORCHCODEC_MAPPING = { |
no test coverage detected