So it seems you should just be able to use the cuda equivalent commands and pytorch should know it’s using ROCm instead (see here). You also might want to check if your AMD GPU is supported here.
But it seems that PyTorch can’t see your AMD GPU.