首页 > 其他 > 详细

torch.cat()

时间:2021-04-25 18:52:49      阅读:19      评论:0      收藏:0      [点我收藏+]

import torch

x = torch.randint(2, 3)
x1 = torch.cat((x, x), 0)
x2 = torch.cat((x, x), 1)
print(x)
print(x1)
print(x2)

结果:
x:([[1, 4, 5],
?? [4, 3, 1]])

x1: ([[1, 4, 5],
???[4, 3, 1],
???[1, 4, 5],
???[4, 3, 1]])

x2: ([[1, 4, 5, 1, 4, 5],
???[4, 3, 1, 4, 3, 1]])

torch.cat()

原文:https://www.cnblogs.com/retrospect/p/14700289.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!