Size([4, 4]) torch.Size([16]) torch.Size([2, 8]). 如果你有一個單元素張量,使用 .item 將值作為Python數字. x = torch.randn(1). print(x).
確定! 回上一頁