torch.stack()和torch.cat()的区别
torch.stack()可以通过torch.cat()表达,即torch.stack(tensors, dim)等价于torch.cat([tensor.unsqueeze(dim) for tensor in tensors ], dim)所以,若能理解torch.cat()函数,即可理解torch.stack()1、torch.cat(tensors, dim)参数: tensors:需要合并的张量集合 dim:需要合并的维度a ......
原创
2022-06-29 19:16:24 ·
490 阅读 ·
0 评论