item() # python float Out[53]: 0 In [54]: d = a[0:1, 0:1, None] print(d.shape) d.item() # 只包含一个元素的tensor即可调用tensor.item,与形状无关 ...
確定! 回上一頁