Pytorch的torch函数使用 import torch as t torch部分函数 t.tensor:创建一个张量 t.from_file/from_numpy:导入生成张量 t.stack:根据dim将张量连接起来,新生成的shape为原本的shape+dim t.cat:不生成新的维度,dim维度进行扩展 tensor.mul:点乘 tensor.matmul:矩阵乘 对张量本身的修改,函数后加上_,例如add_()