Your code should work. Do you get any errors?
It looks like you are using an older PyTorch version.
Have a look at the website 1 for the install instructions for the latest stable release.
Also you are normalizing your train and test dataset before splitting it.
This might overestimate your validation accuracy.
You should split the data, and then scale it.