PyTorch torch.t 関数


Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

torch.tPyTorchにおいて2次元テンソルを転置するための関数です。

関数定義

torch.t(input)

使用例

実例

import torch

x = torch.randn(3, 4)

y = torch.t(x)

print(元の形状:, x.shape)
print(転置後:, y.shape)

Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

その他の拡張