摘要:
import torch x = torch.randint(1,24, (2,3,4)) print(x) x = x.permute(2, 0, 1) print(x) 结果: 前: ([[[15, 23, 21, 14], [ 2, 15, 7, 14], [21, 8, 8, 22]], [ 阅读全文
摘要:
import torch a = torch.arange(2 * 3).view(2, 3) a_sum = torch.sum(a, 0) b = torch.arange(2 * 3 * 4).view(2, 3, 4) b_sum = torch.sum(b, (2, 1)) # 相当于b_ 阅读全文