Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.
# Setup virtual env
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python3 -m venv $VIRTUAL_ENV
RUN . $VIRTUAL_ENV/bin/activate
# install using uv
RUN pip install uv
RUN uv pip install torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/cpu
The index-url makes it really convenient.When installed with brew on my MacBook, uv currently has PyTorch 3.13 as a dependency, which is fine. But PyTorch does not currently have a stable wheel that's compatable with Python 3.13! This resulted in very confusing errors. (Solution was to point to the Nightly index)
That's technically PyTorch's fault, but it's indicitave why a specific page on installing PyTorch is necessary, and it's good to know the documentation specifically calls it out.
[1] https://www.youtube.com/watch?v=gSKTfG1GXYQ
edit: NP-complete not NP-hard
We run internal benchmarks of our custom container image builder and in the 'install torch' benchmark the p50 time saved when using `uv` is 25 seconds! (71.4s vs. 43.74s)
---
Aside 2: Seems there's a missing "involves" in this sentence: "As such, installing PyTorch typically often configuring a project to use the PyTorch index."