How to install Py-torch in your new conda environment

First, change to the environment you want. For me, it is conda activate dlwp

Then, install the basic pytorch:

conda install pytorch torchvision -c pytorch

The recipe is given here: https://pytorch.org/get-started/locally/

Sidenote: if you’re working on ARM (i.e., M1, M2 Mac), you use msp instead of cuda or cpu devices.

Currently (October 2022), mps is supported only in nightly builds of the pytorch.

conda install pytorch torchvision -c pytorch-nightly