快捷方式

torch.unbind

torch.unbind(input, dim=0) seq

移除一個張量維度。

返回沿著給定維度切片得到的元組,切片後該維度已被移除。

引數
  • input (Tensor) – 要拆分的張量

  • dim (int) – 要移除的維度

示例

>>> torch.unbind(torch.tensor([[1, 2, 3],
>>>                            [4, 5, 6],
>>>                            [7, 8, 9]]))
(tensor([1, 2, 3]), tensor([4, 5, 6]), tensor([7, 8, 9]))

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源