As shown in my first example, it will return a RuntimeError.
The shapes are documented in the docs 3.
So I cannot see an error here.
PyTorch 0.4.0 is officially released and you can install it using conda or pip.
Have a look at the website 2 for the install instructions.