Tensor 中只有一个数字时,使用 torch.Tensor.item() 可以得到一个Python数字。 requires_grad 为 True 时,表示需要计算 Tensor 的梯度。
確定! 回上一頁