- 张量的操作:拼接、切分、索引和变换
- 张量的数学运算
- 线性回归
1、张量操作
① 张量的拼接
- torch.cat(tensors,dim,out)
- torch.stack(tensors,dim,out)
② 张量的切分
- torch.chunk(input,chunks,dim)
- torch.split(tensor,split_size_or_sections,dim)
③ 张量的索引
- torch.index_select(input,dim,index,out)
- torch.masked_select(input,mask,out)
④ 张量变换
- torch.reshape(input,shape)
- torch.transpose(input,dim0,dim1)
- torch.t(input)
- torch.squeeze()
- torch.unqueeze()
2、张量数学运算
- 常用数学运算torch.add()、torch.addcdiv()、torch.addcmul()
3、线性回归
损失函数:均方差误差MSE(Mean Square Error)