[FIXED] Pytorch AttributeError: module 'torch' has no ...
www.pythonfixing.com › 2021 › 11Nov 06, 2021 · tl;dr Upgrade to PyTorch 0.4. 1. Notice that DGL requires PyTorch 0.4.1 and you are using PyTorch 0.4.0. If you take a closer look, you'll see that as_tensor was proposed in 30 Apr 2018 and merged in 1 May 2018. You'll also see that PyTorch 0.4.0 was released before that on 24 Apr 2018, whereas PyTorch 0.4.1 was release after on 26 Jul 2018.