Can't find reference 'unsqueeze' in '__init__.py'

my system is osx, when I used torch.unsqueeze or torch.linspace, such like those, return the error: can’t find reference ‘unsqueeze’ in ‘init.py’. What’s the problem? Is my pytorch not install good? Or do I need to install any other moulde?

maybe you have a folder called torch in your current directory, and it’s __init__.py is being used

Thanks. I have fixed it. I think my pytorch didn’t installed good by pip. And I used conda to install again. Then fixed it.

Having the same issue with pip, Pycharm also can’t resolve the functions when installing with pip on OSX.
Don’t really want to change everything to Anaconda though…

You can load Anaconda to Pycharm. Just google how to do it. Coz a little bit complex to tell you by few words.