torch with cuda code example
Example 1: how to install torch cuda 11
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
Example 2: torch conda
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Example 3: pytorch get gpu number
torch.cuda.device_count()
Example 4: install torch anaconda
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch