nn.Linear和nn.BatchNorm1的维度问题
import torchimport torch.nn as nninput=torch.randn([32,49,768])l=nn.Linear(768,512)out=l(input)print(out.shape)# torch.Size([32, 49, 512])# l=nn.Linear(49,512)# mat1 and mat2 shapes cannot be multiplied (1568x768 and 49x512)# 说明了执行linear时,输入的cha