pytorch
-
[PyTorch] nn.Linear의 Weight 행렬은 왜 전치되어 있을까?카테고리 없음 2023. 3. 26. 19:50
Why does the Linear module seems to do unnecessary transposing? I was looking at the code for torch.nn.Linear(in_features, out_features, bias=True) and it seems that it store the matrix one way but then decides that to compute stuff its necessary to transpose (though the transposing seems it could have been avoided). W discuss.pytorch.org PyTorch 공식문서를 보면 nn.Linear의 계산식이 $y=xA^T+b$라고 명시되어있다. $x$..