How do I get the value of a tensor in PyTorch? January 20, 2023 by Tarik You can use x.item() to get a Python number from a Tensor that has one element.