本章代码:https://github.com/zhangxiann/PyTorch_Practice/blob/master/lesson1/linear_regression.py 张量的操作 拼接 torch.cat() torch.cat(tensors, dim=0, out=None) 功能:将张量按照 dim 维度进行拼接 tensors: 张量序列 dim: 要拼接的维度 代码示例: t = torch.ones((2, 3)) t_0 = torch.cat([t, t], d…