範例程式碼. 我們能使用「.item()」 來進行轉換,下面範例程式碼。 import torch a = torch.tensor([2]) print(a) print(a.item()). Python.
確定! 回上一頁