04 2021 档案

摘要:有两个tensor是A和BC = torch.cat( (A,B),0 ) #按维数0拼接(竖着拼) C = torch.cat( (A,B),1 ) #按维数1拼接(横着拼) A = torch.ones(2,3) B = torch.ones(4,3) out=torch.cat((A,B),0 阅读全文
posted @ 2021-04-21 18:20 crazybird123 阅读(78) 评论(0) 推荐(0)
摘要:import torch from torch import nn import torch.nn.functional as F a = torch.tensor([[1,2,3],[4,5,6]]) torch.sum(a) #tensor(21) per_col_sum = torch.sum 阅读全文
posted @ 2021-04-08 15:49 crazybird123 阅读(190) 评论(0) 推荐(0)