This is awsome!! I got the same accuracy and loss. Thank you so much @chenyuntc. And Could you please explain the intution behind using

loss = error.pow(2).sum()/2.0

over

loss = error.pow(2).mean()

especially when you use

error**2).mean().data[0]

while printing the error.
And could you describe how it is similar to Numpy’s implementation

loss = (error ** 2).mean()