Skip to content

Instantly share code, notes, and snippets.

@rendicahya
Last active August 16, 2025 14:05
Show Gist options
  • Save rendicahya/c2c8fc233024631d9c803c32175a1641 to your computer and use it in GitHub Desktop.
Save rendicahya/c2c8fc233024631d9c803c32175a1641 to your computer and use it in GitHub Desktop.

With pip:

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

With conda:

conda create -n <env-name> python=3.10
conda install pytorch==1.13.1 torchvision==0.14.1 pytorch-cuda=11.6 -c pytorch -c nvidia

With Poetry:

[tool.poetry.dependencies]
torch = {version = "1.13.1+cu116", source = "pytorch-cu116"}
torchvision = {version = "0.14.1+cu116", source = "pytorch-cu116"}
numpy = "<2"

[[tool.poetry.source]]
name = "pytorch-cu116"
url = "https://download.pytorch.org/whl/cu116"
priority = "explicit"

Then:

poetry install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment