GPU Machine Learning Mac OS

PyTorch recently announced support for GPU processing on Mac using Apple’s Metal Performance Shaders (MPS) as a backend on the PyTorch v1.12 preview(nightly) build. Cuda implements this simply using

device = torch.device(“cuda:0”)

Is there an equilavent script for MacOS on this new build?

I found an equivalent script:
torch.device("mps")