How to run torch with AMD gpu?

I tried rocm docker but what I can’t understand is how can I check that I am using gpu? with cuda I can do torch.cuda.device_count() but how can I do the same with ROCm?