报错

indices should be either on cpu or on the same device as the indexed tensor (cpu)

原因

版本不对

解决

更换正确版本

conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge