m = nn.Linear(20,1)
input = torch.randn(10, 5, 20)
output = m(input)

output = torch.transpose(output,1,2)
output = torch.transpose(output,0,1)
output=output.contiguous().view(10,5)

Is it right to do so?