Is it ok to use multi dimensinal data for nn.Lienar in 0.2?

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

I’m not sure. But if the input is contiguous, the following code should be equivalent without much performance hit:

fc(a.view(32 * 5, -1)).view(32, 5, 20)

Thank you the comment. If 0.2 already supports multi dimensional nn.Linear, I prefer using it without view.

I understand. Unfortunately, I’m not sure if it is supported. How about upgrading to 0.3?

Yes, My concern is tiny if I update my pytorch… OK, I forget old version’s spec.