I’m an beginner in deep learning
what I’m trying to do is print the epochs, W, b and cost on each steps.
I could print the epochs, b and cost but when I tried to print W, the value error occurs.
I have no idea why it happens.
this is the error what I got.
please someone explain me why this error occurs.
It works perfect without the W part.

ValueError                                Traceback (most recent call last)
 in 
25     optimizer.step()
26
—> 27     print(“epoch : {:4d}/{}, cost : {:.4f}, b : {:.3f}, W : {:.4f}” .format(epoch, nb_epoch, cost.item(), b.item(), W.item()))
ValueError: only one element tensors can be converted to Python scalars