Pytorch相关笔记

torch.nn

  • nn.linear:输入张量的形状: [batch_size, in_features]
    输出张量的形状: [batch_size, out_features]
输入 x (1,4):           A的转置 (4,2):                          输出 (1,2):
[ 1  2  3  4 ]     ×     [ 0.1  0.2 ]                             [ 3.0  2.6 ]
                        [ 0.2  0.3 ]
                        [ 0.3  0.2 ]
                        [ 0.4  0.3 ]