Installing PyTorch on Macbook Pro 2019

According to this thread, PyTorch can be use on Intel Macs, but the functionality is disabled by default. I have changed the code line recommended in this post and compiled pytorch. However, when I run the test code given here, I get the following error:

-[MTLHeapDescriptorInternal validateWithDevice:]:344: failed assertion `Heap Descriptor Validation
Shared storage mode disallowed'

Does anybody have any suggestions on how to fix this?