网络编程
位置:首页>> 网络编程>> Python编程>> pytorch permute维度转换方法

pytorch permute维度转换方法

作者:ShellCollector  发布时间:2023-09-07 17:49:32 

标签:pytorch,permute,维度

permute


prediction = input.view(bs, self.num_anchors,
 self.bbox_attrs, in_h, in_w).permute(0, 1, 3, 4, 2).contiguous()

转置:


import torch

x = torch.linspace(1, 9, steps=9).view(3, 3)

b=x.permute(1,0)
print(b)
print(b.permute(1,0))

来源:https://blog.csdn.net/jacke121/article/details/83044674

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com