How to get the current value of a Variable?

I want to plot my history losses with matplot. But my loss data are returned as Variables from loss function. What’s the way of plotting with PyTorch?

1 Like

You get the value of a Variable using its parameter “data” :

loss = criterion( output, target)
loss_value =[0] 

Wow thank you, this is so easy. Sorry I was stupid.