I noticed nn.Linear
's document is different between 0.2 and master. Now I am using 0.2. But below code is working. Is it ok and expected behavior?
fc = nn.Linear(10, 20)
a = autograd.Variable(torch.randn(32, 5, 10))
b = fc(a)
print('b', b.size()) # 32, 5, 20
- 0.2
Input: (N,in_features)
http://pytorch.org/docs/0.2.0/nn.html?highlight=nn%20linear#torch.nn.Linear - master
Input: (N,∗,in_features)
http://pytorch.org/docs/master/nn.html?highlight=nn%20linear#torch.nn.Linear