摘要:
1.矩阵的转置 方法:t() a=torch.randint(1,10,[2,3]) print(a,'\n') print(a.t()) 输出结果 tensor([[2, 8, 2], [9, 2, 4]]) tensor([[2, 9], [8, 2], [2, 4]]) transpose(维 阅读全文
摘要:
数据本身不发生改变,数据的访问方式发生了改变 1.维度的扩展 函数:unsqueeze() # a是一个4维的 a = torch.randn(4, 3, 28, 28) print('a.shape\n', a.shape) print('\n维度扩展(变成5维的):') print('第0维前加 阅读全文