2021年4月9日

Pytorch中的torch.cat()函数 tensor拼接

摘要: cat是concatnate的意思:拼接,联系在一起。 先说cat( )的普通用法 如果我们有两个tensor是A和B,想把他们拼接在一起,需要如下操作: C = torch.cat( (A,B),0 ) #按维数0拼接(竖着拼) C = torch.cat( (A,B),1 ) #按维数1拼接(横 阅读全文

posted @ 2021-04-09 11:43 星河赵 阅读(5673) 评论(0) 推荐(1) 编辑

Pytorch中保存图片(tensor,cv2,pillow)

摘要: tensor直接保存 #!/usr/bin/env python # _*_ coding:utf-8 _*_ import torch from torchvision import utils as vutils def save_image_tensor(input_tensor: torch 阅读全文

posted @ 2021-04-09 10:56 星河赵 阅读(6783) 评论(0) 推荐(1) 编辑

导航