最近发现光靠想象力已经无法对矩阵的维度进行操作了,比如softmax(dim = xxx),就记着在哪一个维度上操作,固定其他维度,遍历这个坐标就行。
举个例子:
https://blog.csdn.net/sunyueqinghit/article/details/101113251?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2