I have factory reset my iMac today. Installed latest Anaconda, created env, activated env, followed instructions here.
This is the error message I receive when I try to run any code with torch.
File "torch.py", line 1, in <module>
File "/Users/reubenschmidt/code/python/nn/cxr_net/torch.py", line 3, in <module>
x = torch.rand(5,3)
AttributeError: partially initialized module 'torch' has no attribute 'rand' (most likely due to a circular import)
This most likely happens because you have a local file called torch.py. And so when you do import torch, it tries to import that local file instead of the torch library. You should not have a file (or folder) with the same name as a library you use locally to avoid issues