问题:SyntaxError:cannot assign to operator
解决:删掉特殊符号-
问题:TabError: inconsistent use of tabs and spaces in indentation
解决:缩进不使用Tab,用空格
问题:RuntimeError:CUDA error:invalid device ordinal CUDA kernel errors might be asynchronously reported at some other APl call,so the stacktrace below might be incorrect.
解决:将device设置为0,不在代码里修改device,而是通过终端修改
问题:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat2 in method wrapper_mm)
解决:线性层权重在CPU上计算,将linear函数从init放到forward解决。