Here are the most common installation commands:
a) Using pip
For CPU-only PyTorch:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
For GPU with CUDA (e.g., CUDA 11.8):
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
b) Using conda For CPU-only PyTorch:
conda install pytorch torchvision torchaudio cpuonly -c pytorch
For GPU with CUDA (e.g., CUDA 11.8):
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia