You first need to get tensor out of the variable using .data
Then you need to move the tensor to cpu using .cpu()
After that you can convert tensor to numpy using .numpy()
And you probably know the rest… So basically a.data.cpu().numpy()[0] will give you just the value