深入浅出Pytorch函数——torch.t

分类目录:《深入浅出Pytorch函数》总目录
相关文章:
· 深入浅出TensorFlow2函数——tf.transpose
· 深入浅出Pytorch函数——torch.t
· 深入浅出Pytorch函数——torch.transpose
· 深入浅出PaddlePaddle函数——paddle.transpose

语法

torch.t(input) → Tensor

参数

  • input: [Tensor] 输入的张量。

返回值

被转置的张量。

实例

>>> x = torch.randn(())
>>> x
tensor(0.1995)
>>> torch.t(x)
tensor(0.1995)
>>> x = torch.randn(3)
>>> x
tensor([ 2.4320, -0.4608,  0.7702])
>>> torch.t(x)
tensor([ 2.4320, -0.4608,  0.7702])
>>> x = torch.randn(2, 3)
>>> x
tensor([[ 0.4875,  0.9158, -0.5872],
        [ 0.3938, -0.6929,  0.6932]])
>>> torch.t(x)
tensor([[ 0.4875,  0.3938],
        [ 0.9158, -0.6929],
        [-0.5872,  0.6932]])

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
心中带点小风骚的头像心中带点小风骚普通用户
上一篇 2023年7月13日
下一篇 2023年7月13日

相关推荐