To get a value from single element tensor x.item() works always: Example : Single element tensor on CPU x = torch.tensor([3]) x.item(). Output:
確定! 回上一頁